Skip to content

Instantly share code, notes, and snippets.

@rismoney
Last active July 18, 2017 18:45
Show Gist options
  • Save rismoney/8262a6d221e8dd9dcef00f1a24f94146 to your computer and use it in GitHub Desktop.
Save rismoney/8262a6d221e8dd9dcef00f1a24f94146 to your computer and use it in GitHub Desktop.
{
"channelUri": "https://aka.ms/vs/15/release/channel",
"channelId": "VisualStudio.15.Release",
"productId": "Microsoft.VisualStudio.Product.Professional",
"installPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional",
"passive": true,
"includeRecommended": true,
"norestart": false,
"addProductLang": ["en-US"],
"add": ["Microsoft.VisualStudio.Workload.Azure",
"Microsoft.VisualStudio.Workload.Data",
"Microsoft.VisualStudio.Workload.DataScience",
"Microsoft.VisualStudio.Workload.ManagedDesktop",
"Microsoft.VisualStudio.Workload.NetCoreTools",
"Microsoft.VisualStudio.Workload.NetWeb",
"Microsoft.VisualStudio.Workload.Node",
"Microsoft.VisualStudio.Workload.Office",
"Microsoft.VisualStudio.Workload.Python",
"Component.GitHub.VisualStudio"]
}
$driveLetter = ((Get-Volume -FileSystemLabel "vs2017-TP").DriveLetter) + ":"
Set-Location $driveletter
$installFile = Join-Path $driveletter 'vs_professional.exe'
# we add channel and catalog uri here instead of TP.json due to dynamic driveletter from mount.
# --installChannelUri $($driveletter)\ChannelManifest.json
$silentArgs = "--add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.Data --add Microsoft.VisualStudio.Workload.DataScience --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetCoreTools --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.VisualStudio.Workload.Node --add Microsoft.VisualStudio.Workload.Office --add Microsoft.VisualStudio.Workload.Python --add Component.GitHub.VisualStudio --includeRecommended --passive --wait --norestart"
start-process .\certmgr.exe -ArgumentList '-add -c certificates\manifestSignCertificates.p12 -n "Microsoft Code Signing PCA 2011" -s -r LocalMachine CA' -Wait -NoNewWindow
start-process .\certmgr.exe -ArgumentList '-add -c certificates\manifestSignCertificates.p12 -n "Microsoft Root Certificate Authority" -s -r LocalMachine root' -Wait -NoNewWindow
start-process .\certmgr.exe -ArgumentList '-add -c certificates\manifestCounterSignCertificates.p12 -n "Microsoft Time-Stamp PCA 2010" -s -r LocalMachine CA' -Wait -NoNewWindow
start-process .\certmgr.exe -ArgumentList '-add -c certificates\manifestCounterSignCertificates.p12 -n "Microsoft Root Certificate Authority" -s -r LocalMachine root' -Wait -NoNewWindow
start-process .\certmgr.exe -ArgumentList '-add -c certificates\vs_installer_opc.SignCertificates.p12 -n "Microsoft Code Signing PCA" -s -r LocalMachine CA' -Wait -NoNewWindow
start-process .\certmgr.exe -ArgumentList '-add -c certificates\vs_installer_opc.SignCertificates.p12 -n "Microsoft Root Certificate Authority" -s -r LocalMachine root' -Wait -NoNewWindow
start-process $installfile -ArgumentList $silentArgs -Wait -NoNewWindow
@rismoney
Copy link
Author

rismoney commented Jul 17, 2017

this is how i create the layout:

.\vs_Professional.exe --layout Z:\vs2017-TP-en-us-offline --includeRecommended --add Microsoft.VisualStudio.Workload.Azure --add Microsoft.VisualStudio.Workload.Data --add Microsoft.VisualStudio.Workload.DataScience --add Microsoft.VisualStudio.Workload.ManagedDesktop --add Microsoft.VisualStudio.Workload.NetCoreTools --add Microsoft.VisualStudio.Workload.NetWeb --add Microsoft.VisualStudio.Workload.Node --add Microsoft.VisualStudio.Workload.Office --add Microsoft.VisualStudio.Workload.Python --add Component.GitHub.VisualStudio --lang en-US

This 1 line ps works.

When i use ps1.ps1 (above is a snapshot of the relevant parts, at around 50% the installer dies, w/ an error where it looks like an internet url fails unreachable.
Doesn't make any sense.

I have also tried to run the vs_professional.exe with --in switch pointing the json, without success. the dd files always complain about json string issues on L11 or L13 regardless of how i position the [ or ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment