$t=@() $r= new-object -type PSObject class { [string]$a [string[]]$b } $c =get-adgroupmember -recrisive $team| select SamAccountName $c.b = $c.SamAccountName $c.a="dummy" $t += $c $r | add-member -name 'c' -type noteproperty -value $t $r| convertto-json | out-file -filepath .\xyz.json -NOClobber -force this script give { d: [ "a" : "\"sda"\", "\sdd"\" ] }the json is not properly printed also shall I declare $t in class, the slashes are there
↧
Push json string into arraylist convert json element into string instead of remain in its original type
↧