Powershell - Hash Table Escape Quotes -


i retrieve value associated specific item in hash table test not working. me?

$test=  @{"monday" = "a"; "tuesday" = "b"; "wednesday" = "c"; "thursday" = "d"; "friday" = "f"}  $date = get-date $a = $test.get_item($date.get_dayofweek())  write-host $a 

also try:

$test=  @{"monday" = "a"; "tuesday" = "b"; "wednesday" = "c"; "thursday" = "d"; "friday" = "f"}  $date = get-date $a = $date.get_dayofweek() $b = test.get_item($a) 

and:

$test=  @{monday = "a"; tuesday = "b"; wednesday = "c"; thursday = "d"; friday = "f"}  $date = get-date $a = $test.get_item($date.get_dayofweek())  write-host $a 

thanks lot!

dayofweek object not string, try this:

$test[(get-date).dayofweek.tostring()] 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -