I am seeing some rather weird behavior with PowerShell, it looks like custom functions might need a \"parenthesis wrapper\" to evaluate as you might expect them. Given a simple
The second line is not doing a boolean evaluation. Look at what happens if you do the same thing with strings.
PS C:\> function Return-True { return "True string" }
PS C:\> Return-True
True string
PS C:\> Return-True -eq "False string"
True string
PS C:\> (Return-True) -eq "False string"
False
The second line is simply returning the value of the function, and not doing a comparison. I'm not sure exactly why this behavior is happening, but it makes the behavior easier to see than when using boolean values that are being converted to the strings "True" and "False".