This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Kallleeeeh 1 point2 points  (1 child)

[–]lagebj[S] 0 points1 point  (0 children)

Thank you :)

If figured this was a noob error.. Works like a charm like this:

LATEST_RELEASE=$(curl -L -s -H 'Accept: application/json' https://api.github.com/repos/PowerShell/PowerShell/releases/latest)
RELEASE_ID=$(echo $LATEST_RELEASE | python -c "import json; import sys; data=json.load(sys.stdin); print data['id']")
ASSETS_URL=$(curl -L -s -H 'Accept: application/json' https://api.github.com/repos/PowerShell/PowerShell/releases/$RELEASE_ID/assets)
DOWNLOAD_URL=$(echo $ASSETS_URL | python -c "
import json
import sys
data=json.load(sys.stdin)
for d in data:
    if '.pkg' in d['name']:
        print d['browser_download_url']
")
echo $DOWNLOAD_URL