Powershell C# Cmdlet with Hashtable/Dictionary parameters

Question:

Can anyone tell me how to add a parameter to my custom C# cmdlets which is a Hashtable/StringDictionary, so that I can call my cmdlet in a way which resembles this:

I simply cannot find any documentation/example which clearly and simple explains how to do this, or if its even possible for custom cmdlets.

Can i just use:

Or something else?

Kind regards

Answer:

You can use the following

to have the funcitonality like

The output is

4

Clear entry

5

Clear

3

Add

Maximize

Close

Source:

Powershell C# Cmdlet with Hashtable/Dictionary parameters by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply