using foreach you can loop through each name and within that loop through of the roles $json | foreach { $user = $_.name $_.roles | foreach ... ... <看更多>
Convert this json file content to psobject and then convert it back to write it to another file. $o=(Get-Content -Raw D:\Test_Convert.json ... ... <看更多>
RootElement on the instance of JsonDocument gives you the entire JSON object; Root element if it contains array can be indexed; To get the ... ... <看更多>