When you’re using an if statement you’re usually testing for a positive so how do you do a PowerShell if not
There a few scenarios to cover. The simplest is if you’re testing a boolean:
PS> $x = $true
if ($x) {'Yes'} else {'No'}
Yes
In an if… Read the full text.