Skip to content

CI: Report full stack trace if ScriptAnalyzer throws an error and improve ScriptAnalyzer installation to not skip publisher and check and not allow clobber #236

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 15, 2020
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,7 @@ Thank you to all of our contributors, no matter how big or small the contributio
- **[Shannon Deminick (@Shazwazza)](http://github.com/Shazwazza)**
- **[Jess Pomfret (@jpomfret)](https://github.com/jpomfret)**
- **[Giuseppe Campanelli (@themilanfan)](https://github.com/themilanfan)**
- **[Christoph Bergmeister (@bergmeister)](https://github.com/bergmeister)**

----------

Expand Down
4 changes: 2 additions & 2 deletions build/pipelines/templates/run-staticAnalysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

steps:
- powershell: |
Install-Module -Name PSScriptAnalyzer -Repository PSGallery -Scope CurrentUser -AllowClobber -SkipPublisherCheck -Force -Verbose
Install-Module -Name PSScriptAnalyzer -Repository PSGallery -Scope CurrentUser -Force -Verbose
displayName: 'Install PSScriptAnalyzer'

- powershell: |
$results = Invoke-ScriptAnalyzer -Path ./ –Recurse
$results = try { Invoke-ScriptAnalyzer -Path ./ –Recurse -ErrorAction Stop } catch { $_.Exception.StackTrace; throw }
$results | ForEach-Object { Write-Host "##vso[task.logissue type=$($_.Severity);sourcepath=$($_.ScriptPath);linenumber=$($_.Line);columnnumber=$($_.Column);]$($_.Message)" }

$null = New-Item -Path ..\ -Name ScriptAnalyzer -ItemType Directory -Force
Expand Down