-
-
Notifications
You must be signed in to change notification settings - Fork 0
Static analysis: expand PowerShell rules catalog #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
104 commits
Select commit
Hold shift + click to select a range
a5410fe
Static analysis: expand PowerShell rule catalog
PrzemyslawKlys 15c05af
Static analysis: normalize PowerShell metadata text
PrzemyslawKlys b2aa9ef
Static analysis: keep catalog sync script clean
PrzemyslawKlys 9dd0a05
Static analysis: polish PowerShell metadata; test pack wiring
PrzemyslawKlys b18bed0
Static analysis: PowerShell metadata overrides + consistent tags
PrzemyslawKlys 0fdb1db
Static analysis: fix PowerShell metadata typos via overrides
PrzemyslawKlys 73e31c9
Tests: assert PowerShell catalog overrides apply
PrzemyslawKlys 2a517c7
Tests: unify workspace root; sync PowerShell catalog as UTF-8 no BOM
PrzemyslawKlys b481c5b
Static analysis: keep PowerShell catalog sync pristine
PrzemyslawKlys 66cb697
Tests: ensure PowerShell override test is executed
PrzemyslawKlys ef15513
Tests: fix LINQ import; clarify PowerShell docs slugs
PrzemyslawKlys eb47976
Analysis policy: restore review limits; test PowerShell docs URLs
PrzemyslawKlys 219afef
CI: expand reviewer context only for large diffs
PrzemyslawKlys 2445a0e
Tests: make PowerShell docs check non-brittle; guard known typos
PrzemyslawKlys cf4c564
Tests: allow hyphens in Learn docs slugs
PrzemyslawKlys 74c3af9
Catalog sync: preserve docs; harden PSScriptAnalyzer import
PrzemyslawKlys dec04a5
Catalog: fix PowerShell metadata typos; relax docs test
PrzemyslawKlys 2b56222
Catalog: polish PowerShell rule descriptions
PrzemyslawKlys 8a0236c
Tests: enforce Learn docs URL shape; validate PowerShell overrides
PrzemyslawKlys 1b01f7e
Tests: make tag override validation match merge semantics
PrzemyslawKlys d270057
Tests: relax PowerShell docs URL match; guard override tags
PrzemyslawKlys e1a214f
Tests: harden PowerShell docs/override validation
PrzemyslawKlys 017cab7
Catalog sync: generate docs; prune stale rules; expand PowerShell ove…
PrzemyslawKlys 72e8b58
Catalog sync: fix PowerShell typos in generated metadata
PrzemyslawKlys 5b8ac15
Catalog: fix double-period typo; relax PowerShell docs URL regex
PrzemyslawKlys 90bb05b
Tests: speed up override check; harden sync path trust
PrzemyslawKlys 837ac7c
Tests: assert override filenames; allow Learn trailing slash
PrzemyslawKlys 3a348d2
Sync: make pruning opt-in; tests: tag checks order-independent
PrzemyslawKlys 648745a
Tests: allow additive tag overrides; Packs: clarify PowerShell default
PrzemyslawKlys ce42310
Tests: compute override changes from effective vs base
PrzemyslawKlys afc3fce
Tests: fix indentation; Sync: strict read errors
PrzemyslawKlys 7ffc9f7
Sync: restrict pruning target unless forced
PrzemyslawKlys b4e68ef
Tests: relax docs URL enforcement; require overrides actually change
PrzemyslawKlys 8e6e239
Tests: harden PowerShell docs/override validation against bad data
PrzemyslawKlys 379f9ec
PowerShell: relax override test and use approved verb
PrzemyslawKlys 0ddeafa
Tests: make PowerShell base-catalog load self-contained
PrzemyslawKlys 376b87f
Tests: fix PowerShell override loop scoping and UTF-8 reads
PrzemyslawKlys e3aeac9
Tests: best-effort temp cleanup; fix PS mandatory param description
PrzemyslawKlys 9481afd
Tests: harden PowerShell override test temp dir and value kinds
PrzemyslawKlys c2bfdd0
Tests: use explicit empty overrides dir; Script: warn instead of fail…
PrzemyslawKlys 8ad09cd
Tests: log temp cleanup failures; Script: harden prune to workspace
PrzemyslawKlys 596c1ad
Tests: make PowerShell base-catalog comparison unambiguous
PrzemyslawKlys 6fbee04
Tests: simplify temp overrides dir creation
PrzemyslawKlys 7ba7788
Tests: strict Learn docs URLs; fail cleanup on passing tests
PrzemyslawKlys c524389
Tests: guard base rule JSON title/description access
PrzemyslawKlys 191fe4b
PowerShell: DRY default pack and enforce non-redundant overrides
PrzemyslawKlys e421eda
Tests: avoid temp-dir cleanup flake; Script: fail-fast prune deletions
PrzemyslawKlys a5b5a52
Tests: relax tag-only override redundancy; Script: normalize docs URLs
PrzemyslawKlys 1398054
PowerShell sync: avoid empty catch blocks
PrzemyslawKlys d574159
Tests: use empty overrides dir and fix switch formatting
PrzemyslawKlys cd0fa7e
Tests: fix PowerShell override test scoping
PrzemyslawKlys 2741cf3
Tests: clean up PowerShell override switch formatting
PrzemyslawKlys 07bbd3c
Tests: tighten PowerShell docs and tags-only overrides
PrzemyslawKlys 8d507c1
Tests: derive PowerShell docs slug from rule ids
PrzemyslawKlys 9dba5e7
Tests: relax PowerShell docs slug check; harden temp dirs
PrzemyslawKlys 1b97e42
Tests: harden PowerShell override temp dir + Script: case-insensitive…
PrzemyslawKlys a4e580a
Tests: enforce reviewer symbol; Sync: require explicit non-intended p…
PrzemyslawKlys 44be6b6
Sync: restrict PSScriptAnalyzer import to trusted sources
PrzemyslawKlys 7aa799d
Tests: validate powershell-default pack; tighten temp dir; Script: av…
PrzemyslawKlys 427853f
Tests: make PowerShell temp dir fully random; Sync: PS5.1 windows det…
PrzemyslawKlys 112d6e5
Tests: harden overrides test temp dir + ignore unknown override props…
PrzemyslawKlys 6e27210
Tests: use OS temp name for overrides dir; clarify reviewer symbol ga…
PrzemyslawKlys bb297f8
Tests: fix temp-dir creation and indentation in PS overrides test
PrzemyslawKlys b69bf8d
Tests: avoid temp overrides dir; Script: normalize paths and comparisons
PrzemyslawKlys 4573312
Script: use platform-sensitive compare for overrides pruning; fix tes…
PrzemyslawKlys cf304a7
Tests: fail on unknown PowerShell override properties
PrzemyslawKlys 058f4d5
Tests: normalize switch default indentation in PS overrides test
PrzemyslawKlys 93edff0
Script: deterministic JSON output and stricter IO errors
PrzemyslawKlys 03a173b
Script: relax/verify module trust; Tests: validate override tag types
PrzemyslawKlys 2f1292e
Script: fix deterministic JSON null branch
PrzemyslawKlys c963eb1
Script: deterministic key order; Tests: normalize PS override tags block
PrzemyslawKlys 98a82d7
Script: fix JSON escaping; Tests: remove redundant overrides dir check
PrzemyslawKlys f1a04d0
Tests: fix PS override test scoping; Script: normalize non-existent p…
PrzemyslawKlys ae301a2
Script: tighten PSScriptAnalyzer trust + preload docs
PrzemyslawKlys 12d6106
Script: require docs for all generated PowerShell rules
PrzemyslawKlys b6ed5f4
Script: require resolved existing paths for pruning
PrzemyslawKlys f893be3
Script: resolve OutDir via Resolve-Path for pruning checks
PrzemyslawKlys 8775ff2
Tests: use empty overrides dir; Script: fix indent
PrzemyslawKlys 1ec7c65
Tests: normalize PS override test indentation + cleanup
PrzemyslawKlys 50367e4
Tests: fix PS override test scoping and null tag handling
PrzemyslawKlys 27ee614
Tests: fix docs test placement; Script: verify module import
PrzemyslawKlys 7fd2d9b
Tests: qualify MergeTags types + warn on cleanup failure
PrzemyslawKlys 575f3aa
Tests: improve temp cleanup; Script: guard duplicate rule names
PrzemyslawKlys 5857a97
Tests: avoid temp path reassignment in cleanup
PrzemyslawKlys 5544347
Tests: remove global temp cleanup; Script: accept any valid signature
PrzemyslawKlys cb74e09
Tests: assert PSScriptAnalyzer Learn docs slug; Script: clarify PS pr…
PrzemyslawKlys 5021cfb
Tests: add Learn slug overrides for PSScriptAnalyzer
PrzemyslawKlys eade435
Script: fix JSON escaping; Tests: normalize Learn URLs
PrzemyslawKlys 6931e33
Tests: relax PowerShell Learn docs slug assertion
PrzemyslawKlys f636c20
Tests: fail if temp overrides dir can't be deleted
PrzemyslawKlys 77a8f56
Tests: create empty overrides temp dir robustly
PrzemyslawKlys c2763c0
Tests: avoid temp dir leaks; Script: simplify OutDir default
PrzemyslawKlys 10e8876
Tests: harden temp dir helper; split docs test file
PrzemyslawKlys ef70fdc
Tests: scope temp dir lifecycle; avoid docs null-forgiving
PrzemyslawKlys b31995d
Tests: prove overrides root used; Script: normalize workspace root
PrzemyslawKlys 3122261
Tests: avoid temp dir for overrides baseline
PrzemyslawKlys 12fc58e
Tests: fix overrides test scoping; allow no-op overrides
PrzemyslawKlys b5df26d
Script: import PSScriptAnalyzer by path to avoid shadowing
PrzemyslawKlys 2a65b8d
Tests: align overrides assertions with loader semantics
PrzemyslawKlys 8b97844
Script: fail fast on empty rule enumeration; Tests: relax Learn docs …
PrzemyslawKlys 31958dd
Script: validate JSON array items are strings
PrzemyslawKlys 33f9b9c
PowerShell: fix grammar override; Script: remove IN->in rewrite
PrzemyslawKlys ba9926c
PowerShell catalog: pin PSScriptAnalyzer; fix Learn docs locale test
PrzemyslawKlys 664c49d
Merge branch 'master' into codex/static-policy-powershell
PrzemyslawKlys File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
Analysis/Catalog/overrides/powershell/PSAvoidDefaultValueForMandatoryParameter.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "id": "PSAvoidDefaultValueForMandatoryParameter", | ||
| "description": "Mandatory parameters should not be initialized with a default value in the param block because this value will be ignored. To fix a violation of this rule, avoid initializing a value for mandatory parameters in the param block." | ||
| } |
4 changes: 4 additions & 0 deletions
4
Analysis/Catalog/overrides/powershell/PSAvoidDefaultValueSwitchParameter.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "id": "PSAvoidDefaultValueSwitchParameter", | ||
| "description": "Switch parameters should not default to true." | ||
| } |
4 changes: 4 additions & 0 deletions
4
Analysis/Catalog/overrides/powershell/PSAvoidMultipleTypeAttributes.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "id": "PSAvoidMultipleTypeAttributes", | ||
| "description": "Parameters should not have more than one type specifier." | ||
| } |
5 changes: 5 additions & 0 deletions
5
Analysis/Catalog/overrides/powershell/PSUseConsistentIndentation.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "id": "PSUseConsistentIndentation", | ||
| "title": "Use Consistent Indentation", | ||
| "description": "Each statement block should have consistent indentation." | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAlignAssignmentStatement.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAlignAssignmentStatement", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAlignAssignmentStatement", | ||
| "title": "Align Assignment Statements", | ||
| "description": "Line up assignment statements so that the assignment operators are aligned.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/alignassignmentstatement" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidAssignmentToAutomaticVariable.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidAssignmentToAutomaticVariable", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidAssignmentToAutomaticVariable", | ||
| "title": "Changing automatic variables might have undesired side effects", | ||
| "description": "Automatic variables are built into PowerShell and are read-only. Avoid assigning to them.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidassignmenttoautomaticvariable" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidDefaultValueForMandatoryParameter.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidDefaultValueForMandatoryParameter", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidDefaultValueForMandatoryParameter", | ||
| "title": "Avoid Default Value For Mandatory Parameter", | ||
| "description": "Mandatory parameter should not be initialized with a default value in the param block because this value will be ignored. To fix a violation of this rule, please avoid initializing a value for the mandatory parameter in the param block.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoiddefaultvalueformandatoryparameter" | ||
| } | ||
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidDefaultValueSwitchParameter.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidDefaultValueSwitchParameter", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidDefaultValueSwitchParameter", | ||
| "title": "Switch Parameters Should Not Default To True", | ||
| "description": "Switch parameter should not default to true.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoiddefaultvalueswitchparameter" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidExclaimOperator.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidExclaimOperator", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidExclaimOperator", | ||
| "title": "Avoid exclaim operator", | ||
| "description": "The negation operator ! should not be used for readability purposes. Use -not instead.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidexclaimoperator" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidGlobalAliases.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidGlobalAliases", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidGlobalAliases", | ||
| "title": "Avoid global aliases.", | ||
| "description": "Checks that global aliases are not used. Global aliases are strongly discouraged as they overwrite desired aliases with name conflicts.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidglobalaliases" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidGlobalFunctions.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidGlobalFunctions", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidGlobalFunctions", | ||
| "title": "Avoid global functions and aliases", | ||
| "description": "Checks that global functions and aliases are not used. Global functions are strongly discouraged as they can cause errors across different systems.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidglobalfunctions" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidGlobalVars", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidGlobalVars", | ||
| "title": "No Global Variables", | ||
| "description": "Checks that global variables are not used. Global variables are strongly discouraged as they can cause errors across different systems.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidglobalvars" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidInvokingEmptyMembers.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidInvokingEmptyMembers", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidInvokingEmptyMembers", | ||
| "title": "Avoid Invoking Empty Members", | ||
| "description": "Invoking non-constant members would cause potential bugs. Please double check the syntax to make sure members invoked are non-constant.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidinvokingemptymembers" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidLongLines", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidLongLines", | ||
| "title": "Avoid long lines", | ||
| "description": "Line lengths should be less than the configured maximum.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidlonglines" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidMultipleTypeAttributes.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,16 @@ | ||||||
| { | ||||||
| "id": "PSAvoidMultipleTypeAttributes", | ||||||
| "language": "powershell", | ||||||
| "tool": "PSScriptAnalyzer", | ||||||
| "toolRuleId": "PSAvoidMultipleTypeAttributes", | ||||||
| "title": "Avoid multiple type specifiers on parameters", | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Description has a typo (“Prameter”); fix user-facing metadata.
Suggested change
|
||||||
| "description": "Parameter should not have more than one type specifier.", | ||||||
| "category": "BestPractices", | ||||||
| "defaultSeverity": "warning", | ||||||
| "tags": [ | ||||||
| "powershell", | ||||||
| "psscriptanalyzer", | ||||||
| "best-practices" | ||||||
| ], | ||||||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidmultipletypeattributes" | ||||||
| } | ||||||
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidNullOrEmptyHelpMessageAttribute.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidNullOrEmptyHelpMessageAttribute", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidNullOrEmptyHelpMessageAttribute", | ||
| "title": "Avoid using null or empty HelpMessage parameter attribute.", | ||
| "description": "Setting the HelpMessage attribute to an empty string or null value causes PowerShell interpreter to throw an error while executing the corresponding function.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidnulloremptyhelpmessageattribute" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidOverwritingBuiltInCmdlets.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidOverwritingBuiltInCmdlets", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidOverwritingBuiltInCmdlets", | ||
| "title": "Avoid overwriting built in cmdlets", | ||
| "description": "Do not overwrite the definition of a cmdlet that is included with PowerShell.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidoverwritingbuiltincmdlets" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidSemicolonsAsLineTerminators.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidSemicolonsAsLineTerminators", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidSemicolonsAsLineTerminators", | ||
| "title": "Avoid semicolons as line terminators", | ||
| "description": "Line should not end with a semicolon.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidsemicolonsaslineterminators" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidShouldContinueWithoutForce.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidShouldContinueWithoutForce", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidShouldContinueWithoutForce", | ||
| "title": "Avoid Using ShouldContinue Without Boolean Force Parameter", | ||
| "description": "Functions that use ShouldContinue should have a boolean force parameter to allow user to bypass it.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidshouldcontinuewithoutforce" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidTrailingWhitespace.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidTrailingWhitespace", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidTrailingWhitespace", | ||
| "title": "Avoid trailing whitespace", | ||
| "description": "Each line should have no trailing whitespace.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "info", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidtrailingwhitespace" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidUsingAllowUnencryptedAuthentication.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidUsingAllowUnencryptedAuthentication", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidUsingAllowUnencryptedAuthentication", | ||
| "title": "Avoid AllowUnencryptedAuthentication Switch", | ||
| "description": "Avoid sending credentials and secrets over unencrypted connections.", | ||
| "category": "Security", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "security" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidusingallowunencryptedauthentication" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidUsingBrokenHashAlgorithms.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidUsingBrokenHashAlgorithms", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidUsingBrokenHashAlgorithms", | ||
| "title": "Avoid Using Broken Hash Algorithms", | ||
| "description": "Avoid using the broken algorithms MD5 or SHA-1.", | ||
| "category": "Security", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "security" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidusingbrokenhashalgorithms" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidUsingCmdletAliases.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidUsingCmdletAliases", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidUsingCmdletAliases", | ||
| "title": "Avoid Using Cmdlet Aliases or omitting the 'Get-' prefix.", | ||
| "description": "An alias is an alternate name or nickname for a cmdlet or for a command element, such as a function, script, file, or executable file. An implicit alias is also the omission of the 'Get-' prefix for commands with this prefix. But when writing scripts that will potentially need to be maintained over time, either by the original author or another Windows PowerShell scripter, please consider using full cmdlet name instead of alias. Aliases can introduce these problems, readability, understandability and availability.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "warning", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidusingcmdletaliases" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidUsingComputerNameHardcoded.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidUsingComputerNameHardcoded", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidUsingComputerNameHardcoded", | ||
| "title": "Avoid Using ComputerName Hardcoded", | ||
| "description": "The ComputerName parameter of a cmdlet should not be hardcoded as this will expose sensitive information about the system.", | ||
| "category": "BestPractices", | ||
| "defaultSeverity": "error", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "best-practices" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidusingcomputernamehardcoded" | ||
| } |
16 changes: 16 additions & 0 deletions
16
Analysis/Catalog/rules/powershell/PSAvoidUsingConvertToSecureStringWithPlainText.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| { | ||
| "id": "PSAvoidUsingConvertToSecureStringWithPlainText", | ||
| "language": "powershell", | ||
| "tool": "PSScriptAnalyzer", | ||
| "toolRuleId": "PSAvoidUsingConvertToSecureStringWithPlainText", | ||
| "title": "Avoid Using SecureString With Plain Text", | ||
| "description": "Using ConvertTo-SecureString with plain text will expose secure information.", | ||
| "category": "Security", | ||
| "defaultSeverity": "error", | ||
| "tags": [ | ||
| "powershell", | ||
| "psscriptanalyzer", | ||
| "security" | ||
| ], | ||
| "docs": "https://learn.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules/avoidusingconverttosecurestringwithplaintext" | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Contains a double period and pluralization issues; tighten to one clear sentence.