I'm currently in the process of attempting to script (powershell) the automatic installation of Visual Studio 2017 on a VM hosted in an Azure DevTest Lab. The script itself is very simple, i.e.,
try
{
Invoke-WebRequest -Uri $vs2017Url -OutFile $vs2017Exe;
}
catch
{
Write-Error "Failed to download VS 2017";
}
try
{
Start-Process -FilePath $vs2017Exe -ArgumentList "--add Microsoft.VisualStudio.Workload.NetCoreTools;includeRecommended --passive";
}
catch
{
Write-Error "Failed to install VS 2017";
}
where $vs2017Url
is the url of the VS install exe. The problem is that the VS 2017 exe has UAC enabled, which makes it difficult to automate as it throws up the UAC dialog "Do you want to allow this app to make changes to your device?" thereby requiring user intervantion. Is there anyway around this? (The VMs will be deployed using Azure's Artifacts functionality in Azure )