How do I negate a conditional test in PowerShell?
For example, if I want to check for the directory C:\\Code, I can run:
if (Test-Path C:\\Code){ w
if you don't like the double brackets or you don't want to write a function, you can just use a variable.
$path = Test-Path C:\Code if (!$path) { write "it doesn't exist!" }