Magic_Game/scripts/appveyor/appveyor_get_artifacts.ps1

17 lines
483 B
PowerShell
Raw Normal View History

2019-08-06 15:28:45 +08:00
function Get-AppVeyorArtifacts {
param(
[string]$Job
)
if (-not ($env:APPVEYOR_API_TOKEN)) {
throw "missing api token for AppVeyor."
}
if (-not ($env:APPVEYOR_ACCOUNT_NAME)) {
throw "not an appveyor build."
}
return Invoke-RestMethod -Method GET -Uri "https://ci.appveyor.com/api/buildjobs/$Job/artifacts" -Headers @{
"Authorization" = "Bearer $env:APPVEYOR_API_TOKEN"
"Content-type" = "application/json"
}
}