property/Get-LatestVersionOfProperty.ps1
function Get-LatestVersionOfProperty { Param( [Parameter(Mandatory=$true)] [string] $PropertyId, [Parameter(Mandatory=$false)] [string] $GroupID, [Parameter(Mandatory=$false)] [string] $ContractId, [Parameter(Mandatory=$false)] [string] $EdgeRCFile = '~\.edgerc', [Parameter(Mandatory=$false)] [string] $Section = 'papi', [Parameter(Mandatory=$false)] [string] $AccountSwitchKey ) $Path = "/papi/v1/properties/$PropertyId/versions/latest?contractId=$ContractId&groupId=$GroupID&accountSwitchKey=$AccountSwitchKey" try { $Result = Invoke-AkamaiRestMethod -Method GET -Path $Path -EdgeRCFile $EdgeRCFile -Section $Section return $Result.versions.items } catch { throw $_ } } |