I have a Hash Table like this:
$Path = @{
"BM" = "\\srv\xy"
"BB4-L" = "\\srv\xy"
"BB4-R" = "\\srv\xy"
"HSB" = "\\srv\xy"
"IB" = "\\srv\xy"
"LM1" = "\\srv\xy"
"LM2" = "\\srv\xy"
"sis" = "\\srv\xy"
}
my $env:username
is sis. Why does .contains()
and -contains
something different?
PS Z:\Powershell-Scripts\Functions> $Path -contains $env:username
False
PS Z:\Powershell-Scripts\Functions> $Path.contains($env:username)
True
I always like to go with the PowerShell Syntax if possible, but I can't in this case, since -contains
would return false.
How are .contains()
and -contains
different?