Skip to content

Instantly share code, notes, and snippets.

@IlyaFinkelshteyn
Last active June 28, 2018 01:13
Show Gist options
  • Save IlyaFinkelshteyn/9c74bb82c97130565e612389c08bca9f to your computer and use it in GitHub Desktop.
Save IlyaFinkelshteyn/9c74bb82c97130565e612389c08bca9f to your computer and use it in GitHub Desktop.
$env:API_TOKEN = "<replace>" # from https://ci.appveyor.com/api-token
$env:APPVEYOR_ACCOUNT_NAME = "<replace>" # from AppVeyor project URL
$env:APPVEYOR_PROJECT_SLUG = "<replace>" # from AppVeyor project URL
$env:CRONTAB_EXPRESSION = "<replace>" # e.g. "5 * * * *"
$headers = @{
"Authorization" = "Bearer $env:API_TOKEN"
"Content-type" = "application/json"
}
$s = Invoke-RestMethod -Uri "https://ci.appveyor.com/api/projects/$env:APPVEYOR_ACCOUNT_NAME/$env:APPVEYOR_PROJECT_SLUG/settings" -Headers $headers -Method Get
$s.settings.scheduleCrontabExpression = $env:CRONTAB_EXPRESSION
Invoke-RestMethod -Uri 'https://ci.appveyor.com/api/projects' -Headers $headers -Body ($s.settings | ConvertTo-Json -Depth 10) -Method Put
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment