Skip to content

PowerShell If-Not

The If-Not operator is used to convert a value from true to false, or from false to true. Similarly, if an operand evaluates to true, a logical “not” would cause it to evaluate to false. If an operand evaluates to false, its logical “not” equivalent would be true.

Syntax

if(-not(statement)){}

(OR)

if(!(statement)){}

Comments are closed, but trackbacks and pingbacks are open.