Can someone tell me how to add a parameter to my C # custom cmdlets, which is a Hashtable / StringDictionary, so that I can invoke my cmdlet in a way that resembles this:
CustomCmdlet -File $someFilePath ` -StringDictionary/HashtableParameter @{ "name1"="value1" "name2"="value2" "name3"="value3" ... }
I just can't find any documentation / example that clearly and simply explains how to do this, or, if possible, even 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?
Yours faithfully
source share