Skip to content

Commit 701c264

Browse files
committed
Another fix to LibraryUsage.tests.ps1 to accomodate -Fix switch and also return
1 parent 771ffb6 commit 701c264

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Tests/Engine/LibraryUsage.tests.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,12 @@ function Invoke-ScriptAnalyzer {
7878
);
7979

8080
if ($PSCmdlet.ParameterSetName -eq "File") {
81-
$supportsShouldProcessFunc = [Func[string, string, bool]]{ return $Recurse.IsPresent }
82-
$scriptAnalyzer.AnalyzePath($Path, $supportsShouldProcessFunc, $Recurse.IsPresent);
81+
$supportsShouldProcessFunc = [Func[string, string, bool]]{ return $Recurse.IsPresent }
82+
if ($Fix.IsPresent)
83+
{
84+
return $scriptAnalyzer.AnalyzeAndFixPath($Path, $supportsShouldProcessFunc, $Recurse.IsPresent);
85+
}
86+
return $scriptAnalyzer.AnalyzePath($Path, $supportsShouldProcessFunc, $Recurse.IsPresent);
8387
}
8488
else {
8589
return $scriptAnalyzer.AnalyzeScriptDefinition($ScriptDefinition);

0 commit comments

Comments
 (0)