SCAPaoT

System Center, Automation, Powershell and other Thoughts

Tag Archives

Hashtable doesn’t contain a method ‘Ádd’

The powershell has a really nice implementation of a dictionary. It is called Hashtable and can be used to store pairs of keys and values.
Compared with the dictionary used in vbscript, it is really simple to use,
and I have used it several times befor. Till last friday:

There is a method called ‘Add’, really!
And running a get-member agains a hashtable shows at the first entry:

Name         MemberType      Definition
—-              ———-                 ———-
Add            Method                  System.Void Add(System.Object key, System.Object value)

So where the hell does this error come from.
I decided to make a set-psdebug -step in the powershell ISE.
Have a look what I’ve found:

Yes, you can trust your eyes, there is an acute accent on top of the A
Add -> Ádd

Ok, so where are my glasses:

As you can see, using the ISE with a Font Size of 12
and a sceen resolution of 1920 x 1200
makes it hard to see everything clear.

And I’m really glad, that this wasn’t a real bug to my favorite object hashtable.