Seeking a simple way (ideally a single line of code) to check if either of 2 variables is empty something like below, however, this doesn't work...
if ([string]::isnullorempty(var1,var2)) {"empty"} else {"not empty"}
The not operator will convert a string to a boolean. Try this:
if (!$var1 -or !$var2) {"empty"} else {"not empty"}
I think that !$var1 will return $true if $var1 is null or empty.