April 7, 2010

How to verify if a variable exists ?

Test-Path variable:\myVariableName

You can also do the following :

if ($myVariableName) {$true} else {$false}

But this will not work if you have used Set-StrictMode -Version 2.0

No comments:

Post a Comment