msl/List-MSLOriginCPCodes.ps1

function List-MSLOriginCPCodes
{
    Param(
        [Parameter(Mandatory=$false)] [string] [ValidateSet('AKAMAI','THIRD_PARTY')] $Type,
        [Parameter(Mandatory=$false)] [string] $EdgeRCFile = '~\.edgerc',
        [Parameter(Mandatory=$false)] [string] $Section = 'papi',
        [Parameter(Mandatory=$false)] [string] $AccountSwitchKey
    )

    $Path = "/config-media-live/v2/msl-origin/origins/cpcodes?type=$Type&accountSwitchKey=$AccountSwitchKey"

    try {
        $Result = Invoke-AkamaiRestMethod -Method GET -Path $Path -EdgeRCFile $EdgeRCFile -Section $Section
        return $Result
    }
    catch {
        throw $_.Exception
    }
              
}