I have a System.Collections.Generic.Dictionary that I have obtained by running the code snippet below. How do I convert $Obj to a PSCustomObject?
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Web.Extensions")
$jsonserial= New-Object -TypeName System.Web.Script.Serialization.JavaScriptSerializer
$jsonserial.MaxJsonLength = 67108864
$Obj = $jsonserial.DeserializeObject($JsonString)
New-Object
should work from PS 2.0 onwards:
$custom = new-object PSCustomObject -Property $obj
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With