property/List-PapiCPCodes.ps1
function List-PapiCPCodes { Param( [Parameter(Mandatory=$true)] [string] $GroupId, [Parameter(Mandatory=$true)] [string] $ContractId, [Parameter(Mandatory=$false)] [string] $EdgeRCFile = '~\.edgerc', [Parameter(Mandatory=$false)] [string] $Section = 'default', [Parameter(Mandatory=$false)] [string] $AccountSwitchKey ) $Path = "/papi/v1/cpcodes?contractId=$ContractID&groupId=$GroupID&accountSwitchKey=$AccountSwitchKey" try { $Result = Invoke-AkamaiRestMethod -Method GET -Path $Path -EdgeRCFile $EdgeRCFile -Section $Section return $Result.cpcodes.items } catch { throw $_.Exception } } |