PowerShell brain teaser

I've been following the buzz about the PowerShell Scripting Games on Twitter, and came across this PowerShell brain teaser from beefycode. Here's my answer, wish me luck! In PowerShell, when is the following statement true? Explain why.        ( $a -eq $b ) -ne ( $b -eq $a )   The key to this puzzle can be found in PowerShell help:   help about_Comparison_Operators -ShowWindow   Here's the relevant paragraph from the help result:   When the input to an operator is a scalar value, comparison operators return a Boolean value. When the input is a collection of values, the comparison operators return any matching values. If there are no matches in a collection, comparison operators do not return anything.    When we use the -eq operator in PowerShell, most assume…
Read More