Public/New-UserGroup.ps1

<#
    .DESCRIPTION
    Wrapper for Nutanix API version 0.3.
 
    .NOTES
    Author: Timothy Rasiah
#>


function New-UserGroup {
    [CmdletBinding()]
    param (
        [Parameter(Mandatory=$true)]
        [String]$DistinguishedName
    )

    $data = @{
        "spec" = @{
            "resources" = @{
                "directory_service_user_group" = @{
                    "distinguished_name" = $DistinguishedName
                }
            }
        }
        "metadata" = @{
            "kind" = "user_group"
        }
    }

    $response = Send-Request -method "POST" -endpoint "/user_groups" -data $data
    return $response
}