diff --git a/Build/Start-Build.ps1 b/Build/Start-Build.ps1 index 54c0d5f..8122b28 100644 --- a/Build/Start-Build.ps1 +++ b/Build/Start-Build.ps1 @@ -6,7 +6,7 @@ if (Get-NetAdapter | Where-Object Status -ieq 'Up') { # Install dependencies Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null - @('psake', 'PSDeploy', 'BuildHelpers', 'Pester', 'platyps', 'PSScriptAnalyzer', 'PSCoverage', 'CICD'<#, 'PSGitHub'#>) | ForEach-Object { + @('psake', 'PSDeploy', 'BuildHelpers', 'Pester', 'platyps', 'PSScriptAnalyzer', 'PSCoverage', 'CICD', 'PSGitHub') | ForEach-Object { if (-Not (Get-Module -ListAvailable -Name $_)) { "Installing module $_" Install-Module -Name $_ -Scope CurrentUser -AllowClobber -Force diff --git a/Build/deploy.psdeploy.ps1 b/Build/deploy.psdeploy.ps1 index a7c55ab..8f1aa2f 100644 --- a/Build/deploy.psdeploy.ps1 +++ b/Build/deploy.psdeploy.ps1 @@ -86,11 +86,11 @@ if ( "Creating release in GitHub repository" | Write-Host - $GitHubReleaseId = New-GitHubRelease -Owner $env:GitHubOwner -Repository $env:GitHubRepo -Token $env:GitHubToken -Name $env:ModuleVersion -Branch $env:BHBranchName -Body $ReleaseNotes + $GitHubReleaseId = CICD\New-GitHubRelease -Owner $env:GitHubOwner -Repository $env:GitHubRepo -Token $env:GitHubToken -Name $env:ModuleVersion -Branch $env:BHBranchName -Body $ReleaseNotes "Uploading asset to GitHub release" | Write-Host - $GitHubAssetId = New-GitHubReleaseAsset -Owner $env:GitHubOwner -Repository $env:GitHubRepo -Token $env:GitHubToken -Release $GitHubReleaseId -Path $AssetPath + $GitHubAssetId = CICD\New-GitHubReleaseAsset -Owner $env:GitHubOwner -Repository $env:GitHubRepo -Token $env:GitHubToken -Release $GitHubReleaseId -Path $AssetPath } else { diff --git a/Build/psake.ps1 b/Build/psake.ps1 index 7be0227..9368123 100644 --- a/Build/psake.ps1 +++ b/Build/psake.ps1 @@ -37,13 +37,13 @@ Task Analysis -Depends Init { return } - $Files = Get-ChildItem -Path "$env:BHModulePath\*.ps1" -File - $results = $Files | ForEach-Object { Invoke-ScriptAnalyzer -Path $_ -Severity Warning } + $results = Invoke-ScriptAnalyzer -Path $env:BHModulePath -Severity Error,Warning -Recurse if ($results) { $results | Select-Object -Property ScriptName,Line,RuleName,Severity,Message Write-Error 'Failed script analysis. Build failed.' } - $results = $Files | ForEach-Object { Invoke-ScriptAnalyzer -Path $_ -SuppressedOnly } + + $results = Invoke-ScriptAnalyzer -Path $env:BHModulePath -SuppressedOnly -Recurse if ($results) { $results | Select-Object -Property ScriptName,Line,RuleName,Severity,Message,Justification Write-Warning 'Some issues are suppressed from script analysis.'