File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Import-Module PSScriptAnalyzer
2- $ruleName = " UseCompatibleCmdlets "
2+ $ruleName = " PSUseCompatibleCmdlets "
33$directory = Split-Path $MyInvocation.MyCommand.Path - Parent
44$ruleTestDirectory = Join-Path $directory ' UseCompatibleCmdlets'
55
6-
76Describe " UseCompatibleCmdlets" {
87 Context " script has violation" {
98 It " detects violation" {
109 $violationFilePath = Join-Path $ruleTestDirectory ' ScriptWithViolation.ps1'
11- $settingsFilePath = Join- Path $ruleTestDirectory ' PSScriptAnalyzerSettings.psd1'
12- $diagnosticRecords = Invoke-ScriptAnalyzer - Path $violationFilePath - IncludeRule $ruleName - Settings
10+ $settingsFilePath = [ System.IO. Path]::Combine( $ruleTestDirectory , ' PSScriptAnalyzerSettings.psd1' );
11+ $diagnosticRecords = Invoke-ScriptAnalyzer - Path $violationFilePath - IncludeRule $ruleName - Settings $settingsFilePath
1312 $diagnosticRecords.Count | Should Be 1
1413 }
1514 }
Original file line number Diff line number Diff line change 11@ {
22 ' Rules' = @ {
33 ' PSUseCompatibleCmdlets' = @ {
4- ' mode ' = ' offline ' ,
5- ' path ' = ' . '
6- ' compatibility ' = @ { ' core_6.0.0-alpha_windows ' }
4+ ' compatibility ' = @ ( " core-6.0.0-alpha-windows " )
5+ ' mode ' = " offline "
6+ ' uri ' = " C:\users\kabawany\Source\Repos\PSScriptAnalyzer\Tests\Rules\UseCompatibleCmdlets "
77 }
88 }
99}
You can’t perform that action at this time.
0 commit comments