PS> gci C:\
<<here it doesn't print the value of $? as 'true' after command executes>
PS> $?
true
However when I try to recreate this behavior with my own powershell function I get:
PS> function test1 { write-host "hello"; return $true}
PS> test1
hello
true
PS> $?
true
What gives? why can't I hide the return value of the function from the pipeline, and have it only written to the $? variable?