Public/Get-CategoryValue.ps1

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


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

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

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