From fdcef883c3987605fa28d7885a2f64b14841882f Mon Sep 17 00:00:00 2001 From: josetr <37419832+josetr@users.noreply.github.com> Date: Tue, 5 Oct 2021 08:29:39 +0100 Subject: [PATCH] Initialize Visual Studio Experimental Instance on the correct user (#4223) --- images/win/post-generation/VSConfiguration.ps1 | 4 ++++ images/win/scripts/Installers/Install-VS.ps1 | 6 ------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/images/win/post-generation/VSConfiguration.ps1 b/images/win/post-generation/VSConfiguration.ps1 index 47754b4e5..109c69d9f 100644 --- a/images/win/post-generation/VSConfiguration.ps1 +++ b/images/win/post-generation/VSConfiguration.ps1 @@ -1,4 +1,8 @@ $vsInstallRoot = (Get-VisualStudioInstance).InstallationPath $devEnvPath = "$vsInstallRoot\Common7\IDE\devenv.exe" +# Initialize Visual Studio Experimental Instance +# The Out-Null cmdlet is required to ensure PowerShell waits until the '/ResetSettings' command fully completes. +& "$devEnvPath" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit | Out-Null + cmd.exe /c "`"$devEnvPath`" /updateconfiguration" \ No newline at end of file diff --git a/images/win/scripts/Installers/Install-VS.ps1 b/images/win/scripts/Installers/Install-VS.ps1 index bc282b6ce..deefb2019 100644 --- a/images/win/scripts/Installers/Install-VS.ps1 +++ b/images/win/scripts/Installers/Install-VS.ps1 @@ -31,12 +31,6 @@ if ($instanceFolders -is [array]) exit 1 } -$vsInstallRoot = (Get-VisualStudioInstance).InstallationPath - -# Initialize Visual Studio Experimental Instance -# The Out-Null cmdlet is required to ensure PowerShell waits until the '/ResetSettings' command fully completes. -& "$vsInstallRoot\Common7\IDE\devenv.exe" /RootSuffix Exp /ResetSettings General.vssettings /Command File.Exit | Out-Null - # Updating content of MachineState.json file to disable autoupdate of VSIX extensions $newContent = '{"Extensions":[{"Key":"1e906ff5-9da8-4091-a299-5c253c55fdc9","Value":{"ShouldAutoUpdate":false}},{"Key":"Microsoft.VisualStudio.Web.AzureFunctions","Value":{"ShouldAutoUpdate":false}}],"ShouldAutoUpdate":false,"ShouldCheckForUpdates":false}' Set-Content -Path "$vsInstallRoot\Common7\IDE\Extensions\MachineState.json" -Value $newContent