Windows – How to automatically accept privacy agreement when installing VS2017 via the command line

automationpowershellvisual studiowindows

As part of managing environments, I want to install Visual Studio 2017 via the command line. However, I'm running into issues installing 2017 that wasn't encountered setting up 2015. Following the documentation I've got a simple Powershell script:

Start-Process C:\\windows\\temp\\vs2017\\vs_professional_2017 --ArgumentList "/Quiet /NoRestart /Log C:\\Windows\\Temp\\InstallVs2017\\install.log" -Wait

Which worked just fine for VS2015. And it does start the installation, but after a couple of seconds displays the dialog box for accepting the privacy statement and license terms. I can't seem to find a --accepteula flag or something similar to get past it (on a side note, I would have thought that given quiet is supposed to suppress the UI that it would suppress this as well). There is a comment on this issues in the documentation, but they couldn't figure out a way past it. How do you automatically accept it? I feel like I'm missing something obvious, but I have yet to figure it out.

Best Answer

Try these switches, individually and combination, or else open the MSI with Orca and change the EULA variable.

ACCEPT=YES
ACCEPTEULA=1
ASSOCIATE=1