Functions/SystemHealth/Get-PASComponentDetail.ps1

# .ExternalHelp psPAS-help.xml
Function Get-PASComponentDetail {
    [CmdletBinding()]
    param(
        [parameter(
            Mandatory = $true,
            ValueFromPipelinebyPropertyName = $true
        )]
        [ValidateNotNullOrEmpty()]
        [ValidateSet('PVWA', 'SessionManagement', 'CPM', 'AIM', 'PTA')]
        [string]$ComponentID

    )

    BEGIN {
        Assert-VersionRequirement -RequiredVersion 10.1
    }#begin

    PROCESS {

        if ($PSBoundParameters['ComponentID'] -eq 'PTA') {

            Assert-VersionRequirement -RequiredVersion 12.0

        }

        #Create URL for request
        $URI = "$Script:BaseURI/api/ComponentsMonitoringDetails/$ComponentID"

        #send request to web service
        $result = Invoke-PASRestMethod -Uri $URI -Method GET -WebSession $Script:WebSession

        If ($null -ne $result) {

            #output returned data
            $result | Select-Object -ExpandProperty ComponentsDetails

        }

    }#process

    END { }#end

}