Public/new-AllegisIDNIdentityAttribute.ps1

function new-AllegisIDNIdentityAttribute ($orgName, $accessToken, $name){
    $header=get-AllegisIDNprivateHeader $accessToken
    $header+=@{'Content-Type'='application/json'}
    $name=$name.replace('_','')
    $privateuribase="https://$orgname.identitynow.com"
    $url="$privateuribase/cc/api/identityAttribute/create"
    $TextInfo = (Get-Culture).TextInfo
    $sysname=$TextInfo.ToTitleCase($name.tolower()).replace(' ','')
    $sysname=$sysname.ToLower()[0] + $sysname.Substring(1)
    $body="{
    ""name"": ""$sysname"",
    ""multiValued"": false,
    ""namedColumn"": false,
    ""searchable"": false,
    ""silent"": false,
    ""sources"": [{
        ""properties"": {
            ""ruleName"": ""Cloud Promote Identity Attribute""
        },
        ""type"": ""rule""
    }],
    ""standard"": false,
    ""system"": false,
    ""type"": ""string"",
    ""displayName"": ""$name""
}"

    $response=Invoke-WebRequest -Uri $url -Method Post -UseBasicParsing -Headers $header -Body $body
    $sourceIdentityProfile=$response.Content | ConvertFrom-Json
    return $sourceIdentityProfile
}