Check if variable has the right value and are not “null”.
Now how you can check that (check if $variablename has $null as value):
if (!$variablename) { Write-Host “variable is null” }
And here if you wanna check if $variablename has any value except $null:
if ($variablename) { Write-Host “variable is NOT null” }