Ограничить PSScriptAnalyzer ошибками

This commit is contained in:
Devin AI
2026-05-02 08:35:23 +00:00
parent 087883b663
commit 8c9dfffc7d
+1 -13
View File
@@ -40,20 +40,8 @@ jobs:
"windows/*.psm1",
"windows/*.psd1"
)
$settings = @{
Rules = @{
PSAvoidUsingEmptyCatchBlock = @{ Enable = $false }
PSAvoidUsingWriteHost = @{ Enable = $false }
PSUseApprovedVerbs = @{ Enable = $false }
PSUseBOMForUnicodeEncodedFile = @{ Enable = $false }
PSUseDeclaredVarsMoreThanAssignments = @{ Enable = $false }
PSUseShouldProcessForStateChangingFunctions = @{ Enable = $false }
PSUseSingularNouns = @{ Enable = $false }
PSUseToExportFieldsInManifest = @{ Enable = $false }
}
}
$issues = $targets | ForEach-Object {
Invoke-ScriptAnalyzer -Path $_ -Recurse -Severity Error,Warning -Settings $settings
Invoke-ScriptAnalyzer -Path $_ -Recurse -Severity Error
}
if ($issues) {
$issues | Format-Table -AutoSize