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

Popular posts from this blog

Java 8 + Maven Javadoc plugin: Error fetching URL -

css - SVG using textPath a symbol not rendering in Firefox -

c - gcc compile error: unknown type name 'File' -