-
-
Save johnjohnsp1/70893e3aea4579abfba1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Dictionary | |
| { | |
| param([Type[]]$Type, [Hashtable]$Hashtable) | |
| $KeyType = $Type[0] | |
| $ValueType = $Type[1] | |
| $Dictionary = New-Object -TypeName "System.Collections.Generic.Dictionary[$KeyType,$ValueType]" | |
| $Hashtable.GetEnumerator() | % { | |
| $Dictionary.Add($_.Key, $_.Value) | |
| } | |
| $Dictionary | |
| } | |
| Dictionary System.DayOfWeek, String @{ | |
| 'Saturday' = "Caturday"; | |
| 'Sunday' = "Funday"; | |
| } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment