Skip to content

Instantly share code, notes, and snippets.

@Dalmirog-zz
Last active July 22, 2018 23:53
Show Gist options
  • Save Dalmirog-zz/4b45994a2c5f782fd0b4 to your computer and use it in GitHub Desktop.
Save Dalmirog-zz/4b45994a2c5f782fd0b4 to your computer and use it in GitHub Desktop.
Block Octopus Release
$apiKey = "Your API Key"
$OctopusURL = "Your Octopus URL"
$Header = @{ "X-Octopus-ApiKey" = $apiKey }
#Release you want to block
$ReleaseID = "Your Release ID" #i.e. releases-2610
$body = @{description="This is the description for the blocking"} | ConvertTo-Json
Invoke-WebRequest -Uri "$OctopusURL/api/releases/$ReleaseID/defects" -Method Post -Headers $Header -Body $body
@karlmutch
Copy link

Thanks for this fragment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment