Public/set-AllegisIDNsourceSchemaSync.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 |
function set-AllegisIDNsourceSchemaSync ($orgName, $sourceid, $accessToken,$mapping){ $header=get-AllegisIDNprivateHeader $accessToken $header+=@{'Content-Type'='application/json'} $privateuribase="https://$orgname.identitynow.com" $url="$privateuribase/api/source/setAttributeSyncConfig/$sourceid" if (($mapping | gm).TypeName[0] -eq 'System.Management.Automation.PSCustomObject'){ $body=$mapping | ConvertTo-Json -Depth 100 }else{$body=$mapping} #if ($body[0] -ne '['){$body="[$body]"} $response=Invoke-WebRequest -Uri $url -Method post -UseBasicParsing -Headers $header -Body $body $sourceSchema=$response.Content | ConvertFrom-Json return $sourceSchema } |