Skip to content

Instantly share code, notes, and snippets.

@IlyaFinkelshteyn
Last active August 23, 2018 18:41
Show Gist options
  • Save IlyaFinkelshteyn/4d6055e02d6d9e3c962a591628d6556a to your computer and use it in GitHub Desktop.
Save IlyaFinkelshteyn/4d6055e02d6d9e3c962a591628d6556a to your computer and use it in GitHub Desktop.
$apiUrl = "https://ci.appveyor.com/api" # replace with AppVeyor Enterprise URL if needed
$token = "<your_API_token>" # from https://ci.appveyor.com/api-token" or similar AppVeyor Enterprise URL
$buildEnvironmentId = "your_build_environment_id" # you can get it from build environment URL
$newVmSize = "<VM_Size_not_listed_in_AppVeyor_UI>" # https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sizes
$headers = @{
"Authorization" = "Bearer $token"
"Content-type" = "application/json"
}
$originalSettings = Invoke-RestMethod -Uri "$apiUrl/build-clouds/$buildEnvironmentId" -Headers $headers -Method GET
$updateSettings = $originalSettings
$updateSettings.settings.cloudSettings.vmConfiguration.vmSize = $newVmSize
$jsonBody = $updateSettings | ConvertTo-Json -Depth 10
Invoke-RestMethod -Uri "$apiUrl/build-clouds" -Headers $headers -Body $jsonBody -Method Put
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment