While you are writing PowerShell modules, with lot with parameters and you might want to verify these parameters are not ‘null’ to validate some business cases. In normal powershell inline scripting context, $variablename -eq “$null” would work :
if ($varibalename -eq $null) { Write-Host "variable is null.Please supply the values for variablename." }
RECOMMENDED APPROACH:
Efficient way of checking this inside a module is to use:
If you would want to verify $variablename has any value except $null: