Why does Powershell -match any string with $null -
found while debugging powershell script.
ps c:\temp> "hello" -match $null true
but
> "hello" -eq $null returns false
why, when using -match
, string match $null
?
i believe because $null gets coerced empty string -match
expects string pattern on rhs (right hand side). , empty string match anything.
Comments
Post a Comment