Powershell: Adding element to hashtable failed

Question:


Why did it fail? How can I add one element to a hashtable successfully?

Answer:

Correction, this fails because you are missing the @ character in front of @{k="a";b="b"}

@{} is declaring a new hash table. {} is a script block. They are not the same.

Source:

Powershell: Adding element to hashtable failed by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply