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/PSAvoidExclaimOperator is a PSScriptAnalyzer diagnostic emitted by tally for PowerShell snippets embedded in Dockerfiles.
| Property | Value |
|---|---|
| Severity | Warning |
| Category | PSScriptAnalyzer |
| Auto-fix | No |
Description
Avoid using the negation operator (!). Use -not for improved readability.
Upstream PSScriptAnalyzer does not enable this rule by default. Configure
rules.powershell.PSAvoidExclaimOperator.Enable = true to forward the
upstream setting to PSScriptAnalyzer.How to Fix
Replace the! negation operator with the PowerShell -not operator.
Examples
Problematic code
Correct code
Configuration
Upstream PSScriptAnalyzer supports the following rule setting. tally forwards matchingrules.powershell.PSAvoidExclaimOperator options to
PSScriptAnalyzer.
Parameters
-
Enable: bool (Default value is$false) Enable or disable the rule during ScriptAnalyzer invocation.