Search code examples
powershellinterfaceidictionary

How to declare a System.Collections.Generic.IDictionary in powershell


In Powershell I need to pass an input to a method of type System.Collections.Generic.IDictionary[string, system.object].

Could someone please help me with a sample code on how IDictionary[string,system.object] could be declared and value is set to it.


Solution

  • Something like:

    $dict = New-Object 'system.collections.generic.dictionary[[string],[object]]