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:
CustomCmdlet -File $someFilePath `
-StringDictionary/HashtableParameter @{
"name1"="value1"
"name2"="value2"
"name3"="value3"
...
}
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:
[Parameter(Mandatory = false, Position = 9)]
public Dictionary<string,string> FieldValues { get; set; }
[Parameter(Mandatory = false, Position = 9)]
public HashTable FieldValues { get; set; }
...
Or something else?
Kind regards