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
# cases $x = null $x = '' $x = ' ' # test if ($x -and $x.trim()) {'not empty'} else {'empty'} or if ([string]::IsNullOrWhiteSpace($x)) {'empty'} else {'not empty'}