PC一般[PowerShell] 文字列が null または空文字かどうか判定するIsNullOrEmpty を使うのが簡単です。if([string]::IsNullOrEmpty($str)) { # null または空文字の場合の処理 }