Can someone please explain to me why the equality operator in PowerShell is not a symmetric relation??
PS> \"\" -eq 0 False PS> 0 -eq \"\" True
When you do "" -eq 0, it is same as "".equals(0) and it returns false.
"" -eq 0
"".equals(0)
0 -eq "" will try to convert "" to in and [int]"" is 0 and hence you get true.
0 -eq ""
""
[int]""