Уточнить настройки PSScriptAnalyzer

This commit is contained in:
Devin AI
2026-05-02 08:34:21 +00:00
parent 4bbf0b8b73
commit 087883b663
3 changed files with 21 additions and 9 deletions
+13 -1
View File
@@ -40,8 +40,20 @@ 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
Invoke-ScriptAnalyzer -Path $_ -Recurse -Severity Error,Warning -Settings $settings
}
if ($issues) {
$issues | Format-Table -AutoSize