Press "Enter" to skip to content

The If Statement and Friends in Powershell

Kevin Marquette explains what is possible with if in Powershell:

The -not operator flips an expression from $false to $true or from $true to $false. Here is an example where we want to perform an action when Test-Path is $false.
if ( -not ( Test-Path -Path $path ) )

There’s plenty of good stuff here, so check it out.