property/Get-PapiCPCode.ps1
function Get-PapiCPCode { Param( [Parameter(Mandatory=$true)] [string] $CPCode, [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/$CPCode`?contractId=$ContractID&groupId=$GroupID&accountSwitchKey=$AccountSwitchKey" try { $Result = Invoke-AkamaiRestMethod -Method GET -Path $Path -EdgeRCFile $EdgeRCFile -Section $Section return $Result.cpcodes } catch { throw $_.Exception } } |