Monitoring/ECSCapacity.psm1
function Get-ECScapacity { [CmdletBinding(DefaultParameterSetName = '1')] Param ( [Parameter(Mandatory=$false,ValueFromPipelineByPropertyName=$true,ParameterSetName='1')] [Alias("vARRAYid")]$StoragePoolID ) Begin { $Myself = $MyInvocation.MyCommand.Name.Substring(7) $class = "object/$Myself" $Expandproperty = "alert" $Excludeproperty = "id" $ContentType = "application/json" $Method = "Get" } Process { $Uri = "$ECSbaseurl/$class/$StoragePoolID.json" try { Write-Verbose $Uri Invoke-RestMethod -Uri $Uri -Headers $ECSAuthHeaders -Method $Method -ContentType $ContentType # | Select-Object -ExpandProperty $Expandproperty } catch { Get-ECSWebException -ExceptionMessage $_ #$_.Exception.Message break } } End { } } |