Created
May 11, 2026 12:11
-
-
Save zhangyoufu/3ca7f93f821505dc3f4dde09f901f620 to your computer and use it in GitHub Desktop.
get download URL for single component within Visual Studio, given chman/vsman URL
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
| f() { | |
| local URL | |
| URL=$1 | |
| if [ "${URL%.chman}" != "${URL}" ]; then | |
| echo >&2 "downloading chman from ${URL}" | |
| URL=$(curl -fsS "${URL}" | jq -r '.channelItems[0].payloads[0].url') | |
| fi | |
| if [ "${URL%.vsman}" = "${URL}" ]; then | |
| echo "invalid URL_vsman" | |
| return 1 | |
| fi | |
| echo >&2 "downloading vsman from ${URL}" | |
| curl -fsS "${URL}" | jq '.packages[] | select(.id == "Microsoft.VisualC.140.Dia.SDK.Msi") | {version,"file":[.payloads[] | {sha256,url}]}' | |
| } | |
| f https://download.visualstudio.microsoft.com/download/pr/8807d71a-11f0-4c53-85c1-3f884f4ab74c/b8d2672cf46ca2fbddbb1b458cec7e00c2ec5d45a2c3e754acccc64f64259945/VisualStudio.15.Release.chman | |
| # https://download.visualstudio.microsoft.com/download/pr/12045832/dd2eadc559116af0c1fdeecec29c0d29/VC_diasdk.msi | |
| # https://download.visualstudio.microsoft.com/download/pr/12045832/dd2eadc559116af0c1fdeecec29c0d29/cab1.cab |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment