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 -

android - How to delete or change the searchview icon inside the SearchView actionBar? -

c++ - Msgpack packing bools bug -