Is there a built-in IsNullOrEmpty-like function in order to check if a string is null or empty, in PowerShell?
IsNullOrEmpty
I could not find it so far and if there i
An extension of the answer from Keith Hill (to account for whitespace):
$str = " " if ($str -and $version.Trim()) { Write-Host "Not Empty" } else { Write-Host "Empty" }
This returns "Empty" for nulls, empty strings, and strings with whitespace, and "Not Empty" for everything else.