Skip to content

Instantly share code, notes, and snippets.

@Dalmirog-zz
Created February 6, 2015 19:25
Show Gist options
  • Save Dalmirog-zz/d1610bdb2c99e932d933 to your computer and use it in GitHub Desktop.
Save Dalmirog-zz/d1610bdb2c99e932d933 to your computer and use it in GitHub Desktop.
Set-OctopusMaintenanceMode
$apiKey = "Your API Key"
$OctopusURL = "Your Octopus URL"
$MaintenanceMode = "True" #Only accepts "True" or "False". Values must be strings
$Header = @{ "X-Octopus-ApiKey" = $apiKey }
$body = @{IsInMaintenanceMode=$MaintenanceMode} | ConvertTo-Json
Invoke-WebRequest -Uri "$OctopusURL/api/maintenanceconfiguration" -Method PUT -Headers $Header -Body $body
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment