<p>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 PowerShell function:</p>

<pre><code>function Return-True { return $true }
</code></pre>

<p>and then some sample code to invoke it:</p>

<pre><code>PS C:\&gt; Return-True
True
PS C:\&gt; Return-True -eq $false
True
PS C:\&gt; (Return-True) -eq $false
False
</code></pre>

<p>Ideas? Comments? </p>

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".