Documentation Index
Fetch the complete documentation index at: https://tally.wharflab.com/llms.txt
Use this file to discover all available pages before exploring further.
powershell/PSAvoidOverwritingBuiltInCmdlets is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
| Property | Value |
|---|---|
| Severity | Warning |
| Category | PSScriptAnalyzer |
| Auto-fix | No |
Description
This rule flags cmdlets that are available in a given edition/version of PowerShell on a given operating system which are overwritten by a function declaration. It works by comparing function declarations against a set of allowlists that ship with PSScriptAnalyzer. These allowlist files are used by other PSScriptAnalyzer rules. More information can be found in the documentation for the UseCompatibleCmdlets rule.Configuration
To enable the rule to check if your script is compatible on PowerShell Core on Windows, put the following in your settings file.tally forwards matching
rules.powershell.PSAvoidOverwritingBuiltInCmdlets options to PSScriptAnalyzer.Parameters
PowerShellVersion
The parameterPowerShellVersion is a list of allowlists that ship with PSScriptAnalyzer.
In upstream PSScriptAnalyzer, the default value for
PowerShellVersion is core-6.1.0-windows if PowerShell 6 or later is installed, and
desktop-5.1.14393.206-windows if it is not. tally itself requires pwsh 7.x as the analyzer host and does not support powershell.exe or Windows
PowerShell 5.1 as the host process.JSON into the
Settings folder of the PSScriptAnalyzer module installation folder, then the PowerShellVersion
parameter is just its filename (that can also be changed if desired). Note that the core-6.0.2-*
files were removed in PSScriptAnalyzer 1.18 since PowerShell 6.0 reached end of life.