src/Get-HighWindsOrigin.ps1
function Get-HighWindsOrigin { Param( [Parameter(Mandatory)] [String] $Token, [Parameter(Mandatory)] [String] $AccountHash, [Parameter()] [String] $OriginID ) if ($OriginID) { $Path = "/api/v1/accounts/$AccountHash/origins/$OriginID" } else { $Path = "/api/v1/accounts/$AccountHash/origins" } $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 ($OriginID) { return $Result } else { return $Result.List } } catch { throw $_ } } |