Public/new-AllegisIDNsourceSchemaImportAttribute.ps1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function new-AllegisIDNsourceSchemaImportAttribute ($orgName, $sourceid, $accessToken, $name, $type, $description, $multi){ $header=get-AllegisIDNprivateHeader $accessToken $header+=@{'Content-Type'='application/x-www-form-urlencoded'} $header+=@{'charset'='UTF-8'} $privateuribase="https://$orgname.api.identitynow.com" $url="$privateuribase/cc/api/source/createSchemaAttribute/$sourceid" if ($multi -ne $true){ $body="name=$name&description=$description&type=$type&objectType=account" }else{ $body="name=$name&description=$description&type=$type&multi=true&objectType=account" } $response=Invoke-WebRequest -Uri $url -Method Post -UseBasicParsing -Headers $header -Body $body $sourceSchema=$response.Content | ConvertFrom-Json return $sourceSchema } |