Powershell - What does if($variable) test for? -
in powershell, if($variable)
test for? testing if variable set, null, true, or else?
it tests whether variable true or whether non-boolean variable can coalesced true. example, each of these return false:
$var #uninitialized $var = "" $var = $false $var = 0
each of these return true:
$var = "something" $var = $true $var = 1 #or non-zero number
Comments
Post a Comment