Skip to content

PSScriptAnalyzer rules to help migrating PowerShell 5.1 scripts to PowerShell 7

Notifications You must be signed in to change notification settings

janestreet/PS7CompatibilityRules

Repository files navigation

A collection of PSScriptAnalyzer rules to highlight potential PowerShell 7 compatibility issues when migrating from PowerShell 5.1

Usage

git clone https://github.com/janestreet/PS7CompatibilityRules.git
Invoke-ScriptAnalyzer -Path '<your_code_path>' -Recurse -CustomRulePath .\PS7CompatibilityRules

Included Rules

Rule Description
AvoidDeprecatedCommands Flag commands that are listed on Microsoft's website as incompatible with PS7
AvoidDeprecatedTypes Flag references to deprecated types that are incompatible with PS7
AvoidGetSetAccessControl Flag GetAccessControl() or SetAccessControl() calls
CommandRecommendations Recommendations for specific commands that have different behavior in PS7
NoHtmlParsing Flag code that relies on HTML parsing done in web cmdlets
SelectObjectMustSpecifyProperty Select-Object ExcludeProperty is effective only when the command also includes a Property parameter

About

PSScriptAnalyzer rules to help migrating PowerShell 5.1 scripts to PowerShell 7

Topics

Resources

Stars

Watchers

Forks