Last active
July 15, 2019 23:47
-
-
Save goyalmohit/fb5d5d9655e07c1b626367e2a2cab47c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
""" | |
Parse output from az pipelines list command into a nice format using python | |
Below code assumes that output from 'az pipelines list' command has been stored | |
under the az-pipelines-list.json file | |
""" | |
import sys, json | |
with open("working-with-azure-devops-pipelines-at-command-line/az-pipelines-list.json", "r") as f: | |
pipelines = json.load(f) | |
print(f"PipelineName \t CreationDate \t AuthoredBy \t ProjectName") | |
for item in pipelines: | |
authored_by = item['authoredBy']['displayName'] | |
project_name = item['project']['name'] | |
print(f"{item['name']} \t {item['createdDate']} \t {authored_by} {project_name}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment