Created
October 21, 2014 11:59
-
-
Save DamianMac/1b417012dd1f7dfc49d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$server = "http://blah" | |
$apiKey = "API-XXXXXXXXXXXXXXXX" | |
$command = $($server + "/api/tasks") | |
$task = @{} | |
$task.Name = "Backup" | |
$task.Description = "Backup requested via API" | |
$body = $task | ConvertTo-Json | |
$new = Invoke-RestMethod -Method Post -Uri $command -Body $body -Header @{"X-Octopus-ApiKey"=$apiKey} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for this sample! It's very useful!