Skip to content

Commit 61d0636

Browse files
authored
Fix the issue that ExampleAnalyzer is blocked by -Debug flag (#24342)
* Ping the version of PSScriptAnalyzer * Ping the version of PSScriptAnalyzer
1 parent 3318943 commit 61d0636

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@
221221

222222
<Target Name="StaticAnalysisExample" Condition="'$(RunStaticAnalysis)' == 'true'" AfterTargets="StaticAnalysisHelp">
223223
<Message Importance="high" Text="Running static analysis for PowerShell examples..." />
224-
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)StaticAnalysis/ExampleAnalyzer/Measure-MarkdownOrScript.ps1 -MarkdownPaths $(RepoArtifacts)FilesChanged.txt -RulePaths $(RepoTools)StaticAnalysis/ExampleAnalyzer/AnalyzeRules/*.psm1 &quot;"/>
224+
<Exec Command="$(PowerShellCoreCommandPrefix) &quot;. $(RepoTools)StaticAnalysis/ExampleAnalyzer/Measure-MarkdownOrScript.ps1 -MarkdownPaths $(RepoArtifacts)FilesChanged.txt -RulePaths $(RepoTools)StaticAnalysis/ExampleAnalyzer/AnalyzeRules/*.psm1 -NotCleanScripts &quot;"/>
225225
</Target>
226226

227227
<Target Name="StaticAnalysisFileChange" Condition="'$(RunStaticAnalysis)' == 'true'">

tools/StaticAnalysis/ExampleAnalyzer/utils.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,10 +494,10 @@ function Get-ScriptAnalyzerResult {
494494

495495
# Invoke PSScriptAnalyzer : input scriptblock, output error set in $result with property: RuleName, Message, Extent
496496
if ($null -eq $RulePaths) {
497-
$analysisResults = Invoke-ScriptAnalyzer -Path $ScriptPath -IncludeDefaultRules:$IncludeDefaultRules.IsPresent -Debug
497+
$analysisResults = Invoke-ScriptAnalyzer -Path $ScriptPath -IncludeDefaultRules:$IncludeDefaultRules.IsPresent
498498
}
499499
else {
500-
$analysisResults = Invoke-ScriptAnalyzer -Path $ScriptPath -CustomRulePath $RulePaths -IncludeDefaultRules:$IncludeDefaultRules.IsPresent -Debug
500+
$analysisResults = Invoke-ScriptAnalyzer -Path $ScriptPath -CustomRulePath $RulePaths -IncludeDefaultRules:$IncludeDefaultRules.IsPresent
501501
}
502502
$errors = @()
503503
foreach($analysisResult in $analysisResults){

0 commit comments

Comments
 (0)