Most commands support printing the result in JSON format.
Dump Deployment, Export and Import do not support JSON output.
To access JSON formatted output, use the --outputformat=json
parameter.
octo list-projects --server https://your-octopus-url --apiKey API-YOUR-KEY --outputformat=json
This command outputs the list of projects in parsable JSON format:
[
{
"Id": "Projects-81",
"Name": "Phoenix"
},
{
"Id": "Projects-61",
"Name": "OctoFX"
},
]
You can also work with the JSON output in PowerShell:
$json = (./octo list-releases --server https://your-octopus-url --apikey API-YOUR-KEY --project=OctoLifecycle --outputformat=json) | ConvertFrom-Json
$json | select -expand Releases | where {[datetime]$_.Assembled -gt ((Get-Date).AddMonths(-1))}
This script writes out a list of releases for the last month:
Version Assembled PackageVersions ReleaseNotes
------- --------- --------------- ------------
0.0.16 2018-01-04T14:27:25.221+10:00 Deploy1 0.0.1
0.0.15 2018-01-04T14:14:29.369+10:00 Deploy1 0.0.1
0.0.14 2018-01-04T14:06:55.799+10:00 Deploy1 0.0.1
0.0.13 2018-01-04T14:06:44.784+10:00 Deploy1 0.0.1
0.0.12 2018-01-04T13:44:29.273+10:00 Deploy1 0.0.1
0.0.11 2017-12-18T09:36:44.995+10:00 Deploy 0.0.1
0.0.10 2017-12-18T09:26:22.671+10:00 Deploy 0.0.1
0.0.9 2017-12-18T09:25:02.342+10:00 Deploy 0.0.1
Learn more
Help us continuously improve
Please let us know if you have any feedback about this page.
Page updated on Sunday, January 1, 2023