# Set $a as an EMPTY array $a = @() # Now test it if ($a) { Write-Host "has value" } else { Write-Host "NULL or EMPTY"} # Set $a as a NULL $a = $null # Now test it if ($a) { Write-Host "has value" } else { Write-Host "NULL or EMPTY"}
The output is:
NULL or EMPTY
NULL or EMPTY
There you have it. I tend to use beacuse it looks clean, but as I like to say, "Programming is an Art, and there are a lot of crappy painters out there".