| description | Avoid exclaim operator |
|---|---|
| ms.custom | PSSA v1.21.0 |
| ms.date | 06/14/2023 |
| ms.topic | reference |
| title | AvoidExclaimOperator |
Severity Level: Warning
The negation operator ! should not be used for readability purposes. Use -not instead.
Note: This rule is not enabled by default. The user needs to enable it through settings.
$MyVar = !$true$MyVar = -not $trueRules = @{
PSAvoidExclaimOperator = @{
Enable = $true
}
}Enable or disable the rule during ScriptAnalyzer invocation.