Public/Get-Category.ps1

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


function Get-Category {
    [CmdletBinding()]
    param (
        $name
    )
    
    $data = @{
        "kind" = "category"
    }

    if (-not $name) {
        $response = Send-Request -method "POST" -endpoint "/categories/list" -data $data
        return $response.entities
    }

    $response = Send-Request -method "GET" -endpoint "/categories/$($name)"
    return $response
}