powershell - Adding element to hashtable failed -


ps c:\users\hind> $b=@{} ps c:\users\hind> $b+={k="a";v="b"} hash table can added hash table. @ line:1 char:1 + $b+={k="a";v="b"} + ~~~~~~~~~~~~~~~~~ + categoryinfo          : invalidoperation: (:) [], runtimeexception + fullyqualifiederrorid : addhashtabletononhashtable 

why did fail? how can add 1 element hashtable successfully?

correction, fails because missing @ character in front of @{k="a";b="b"}

 ps c:\users\hind> $b=@{} ps c:\users\hind> $b+=@{k="a";v="b"} 

@{} declaring new hash table. {} script block. not same.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -