property/Get-PropertyActivation.ps1
function Get-PropertyActivation { Param( [Parameter(ParameterSetName="name", Mandatory=$true)] [string] $PropertyName, [Parameter(ParameterSetName="id", Mandatory=$true)] [string] $PropertyId, [Parameter(Mandatory=$true)] [string] $ActivationID, [Parameter(Mandatory=$false)] [string] $GroupID, [Parameter(Mandatory=$false)] [string] $ContractId, [Parameter(Mandatory=$false)] [string] $EdgeRCFile = '~\.edgerc', [Parameter(Mandatory=$false)] [string] $Section = 'default', [Parameter(Mandatory=$false)] [string] $AccountSwitchKey ) if($PropertyName){ $PropertyID = (Find-Property -PropertyName $PropertyName -latest -EdgeRCFile $EdgeRCFile -Section $Section -AccountSwitchKey $AccountSwitchKey).propertyId if($PropertyID -eq ''){ throw "Property '$PropertyName' not found" } } $Path = "/papi/v1/properties/$PropertyId/activations/$ActivationID`?contractId=$ContractId&groupId=$GroupID&accountSwitchKey=$AccountSwitchKey" try { $Result = Invoke-AkamaiRestMethod -Method GET -Path $Path -EdgeRCFile $EdgeRCFile -Section $Section return $Result.activations.items } catch { throw $_.Exception } } |