File tree Expand file tree Collapse file tree 5 files changed +39
-3
lines changed Expand file tree Collapse file tree 5 files changed +39
-3
lines changed Original file line number Diff line number Diff line change 1+ {
2+ // Use IntelliSense to learn about possible attributes.
3+ // Hover to view descriptions of existing attributes.
4+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+ "version" : " 0.2.0" ,
6+ "configurations" : [
7+ {
8+ // Run this launch config and then set breakpoints in your module.
9+ // Then you can `Import-Module -Force ./PowerShellForGitHub.psd1`
10+ // and run a function that will hit the breakpoint.
11+ "name" : " PowerShell: Interactive Session" ,
12+ "type" : " PowerShell" ,
13+ "request" : " launch" ,
14+ "cwd" : " "
15+ }
16+ ]
17+ }
Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ Update-Module -Name PSScriptAnalyzer
153153Once it's installed (or updated), from the root of your enlistment simply call
154154
155155``` powershell
156- Invoke-ScriptAnalyzer -Path .\ -Recurse
156+ Invoke-ScriptAnalyzer -Settings ./PSScriptAnalyzerSettings.psd1 - Path ./ -Recurse
157157```
158158
159159That should return with no output. If you see any output when calling that command,
Original file line number Diff line number Diff line change 1+ # PSScriptAnalyzerSettings.psd1
2+ # Settings for PSScriptAnalyzer invocation.
3+ # All default rules are also enabled.
4+ @ {
5+ Rules = @ {
6+ PSUseCompatibleSyntax = @ {
7+ # This turns the rule on (setting it to false will turn it off)
8+ Enable = $true
9+
10+ # Simply list the targeted versions of PowerShell here
11+ TargetVersions = @ (
12+ ' 4.0' ,
13+ ' 5.1' ,
14+ ' 6.2' ,
15+ ' 7.0'
16+ )
17+ }
18+ }
19+ }
Original file line number Diff line number Diff line change 99 displayName: 'Install PSScriptAnalyzer'
1010
1111 - powershell : |
12- $results = try { Invoke-ScriptAnalyzer -Path ./ –Recurse -ErrorAction Stop } catch { $_.Exception.StackTrace; throw }
12+ $results = try { Invoke-ScriptAnalyzer -Settings ./PSScriptAnalyzerSettings.psd1 - Path ./ –Recurse -ErrorAction Stop } catch { $_.Exception.StackTrace; throw }
1313 $results | ForEach-Object { Write-Host "##vso[task.logissue type=$($_.Severity);sourcepath=$($_.ScriptPath);linenumber=$($_.Line);columnnumber=$($_.Column);]$($_.Message)" }
1414
1515 $null = New-Item -Path ..\ -Name ScriptAnalyzer -ItemType Directory -Force
Original file line number Diff line number Diff line change 1616 Overwrite the file at Path if it exists.
1717
1818 . EXAMPLE
19- $results = Invoke-ScriptAnalyzer -Path ./ -Recurse
19+ $results = Invoke-ScriptAnalyzer -Settings ./PSScriptAnalyzerSettings.psd1 - Path ./ -Recurse
2020 .\ConverTo-NUnitXml.ps1 -ScriptAnalyzerResult $results -Path ./PSScriptAnalyzerFailures.xml
2121#>
2222[CmdletBinding ()]
You can’t perform that action at this time.
0 commit comments