src/Get-HighWindsConfigScope.ps1

function Get-HighWindsConfigScope {
    Param(
        [Parameter(Mandatory)]
        [String]
        $Token,
        
        [Parameter(Mandatory)]
        [String]
        $AccountHash,

        [Parameter()]
        [String]
        $HostHash,
        
        [Parameter()]
        [String]
        $ScopeID
    )

    if ($ScopeID) {
        $Path = "/api/v4/cdn/accounts/$AccountHash/sites/$HostHash/configuration/$ScopeID"
    }
    else {
        $Path = "/api/v1/accounts/$AccountHash/hosts/$HostHash/configuration/scopes"
    }
    
    $URI = 'https://striketracker.highwinds.com' + $Path
    $Headers = @{
        'Content-Type'  = 'application/json'
        'Accept'        = 'application/json'
        'Authorization' = "Bearer $Token"
    }

    try {
        $Result = Invoke-RestMethod -Method GET -Uri $URI -Headers $Headers -Proxy $env:https_proxy
        if ($ScopeID) {
            return $Result
        }
        else {
            return $Result.List
        }
        
    }
    catch {
        throw $_
    }  
}