I'm confused about the difference between these two things:
$env:path
And
function path {$env:path}
path
Both return strings, according to get-member. Yet -match does not work the same on both.
If I use -match on $env:path, it works as I'd expect, returning true/false. But if I use -match on path (the new function) then it always returns the path, ignoring the -match.
I'm confused because both return strings and therefore ought to work the same. Does the function need to do something special to get the same result?