Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 223568

Re: Switch statement and hash table

$
0
0

I think i've got it now.  I think it makes more sense here if I break it down.  So you can do a script block for Switch to evaluate if true and if you have an object you can do "object -eq "string" " and powershell knows to evaluate and return true?

 

Man I don't think I could figure out that logic on my own

 

$myhash.GetEnumerator() | where {$_.name -eq "c"
}

Name                           Value
----                           -----
c                              3


$hash = $myhash.GetEnumerator() | where {$_.name -eq "c"}
$hash

Name                           Value
----                           -----
c                              3


$hash.Name
c

$hash.Name -eq "c"

True


Viewing all articles
Browse latest Browse all 223568

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>