msl/New-MSLKey.ps1
function New-MSLKey { 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/generate-key?type=$Type&accountSwitchKey=$AccountSwitchKey" try { $Result = Invoke-AkamaiRestMethod -Method GET -Path $Path -EdgeRCFile $EdgeRCFile -Section $Section return $Result } catch { throw $_.Exception } } |