Try it without the quote marks around $null.
What I think is happening is the “$null” actually represents an empty string and an empty string is not the same as a null object.
$string = "$null" Write-Output ($string -eq $null)
Try it without the quote marks around $null.
What I think is happening is the “$null” actually represents an empty string and an empty string is not the same as a null object.
$string = "$null" Write-Output ($string -eq $null)