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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -