From cd6f1f57743acb49c9b1165a434bae4e49fdfd4e Mon Sep 17 00:00:00 2001 From: Cory Knox <30301021+corbob@users.noreply.github.com> Date: Thu, 17 Oct 2024 22:18:14 -0700 Subject: [PATCH] (#209) Disable Browser First Run Wizards (#522) Add function to disable browser first run wizards so that PowerShell Invoke-WebRequest can work correctly, and so that Edge doesn't pester the user to configure it. --- .../Boxstarter.WinConfig.psd1 | 4 +-- .../Disable-BoxstarterBrowserFirstRun.ps1 | 29 +++++++++++++++++++ 2 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 Boxstarter.WinConfig/Disable-BoxstarterBrowserFirstRun.ps1 diff --git a/Boxstarter.WinConfig/Boxstarter.WinConfig.psd1 b/Boxstarter.WinConfig/Boxstarter.WinConfig.psd1 index 50464c2b..65247ead 100644 --- a/Boxstarter.WinConfig/Boxstarter.WinConfig.psd1 +++ b/Boxstarter.WinConfig/Boxstarter.WinConfig.psd1 @@ -47,7 +47,8 @@ CmdletsToExport = @( 'Set-WindowsExplorerOptions', 'Set-BoxstarterTaskbarOptions', 'Disable-BingSearch', - 'Set-BoxstarterPageFile' + 'Set-BoxstarterPageFile', + 'Disable-BoxstarterBrowserFirstRun' ) # Variables to export from this module @@ -69,4 +70,3 @@ PrivateData = '8459d49a8d5a049d8936519ccf045706c7b3eb23' # DefaultCommandPrefix = '' } - diff --git a/Boxstarter.WinConfig/Disable-BoxstarterBrowserFirstRun.ps1 b/Boxstarter.WinConfig/Disable-BoxstarterBrowserFirstRun.ps1 new file mode 100644 index 00000000..a06291a1 --- /dev/null +++ b/Boxstarter.WinConfig/Disable-BoxstarterBrowserFirstRun.ps1 @@ -0,0 +1,29 @@ +function Disable-BoxstarterBrowserFirstRun { + <# + .SYNOPSIS + Turns off IE and Edge first run customization wizards. + + .LINK + https://boxstarter.org + + .EXAMPLE + Disable-BrowserFirstRun + + Turns off IE and Edge first run customization wizards. + #> + $RegistryKeys = @( + @{ Key = 'HKLM:\Software\Policies\Microsoft\Edge' ; Value = 'HideFirstRunExperience' } # Edge + @{ Key = 'HKLM:\Software\Microsoft\Internet Explorer\Main' ; Value = 'DisableFirstRunCustomize' } # Internet Explorer 11 + @{ Key = 'HKLM:\Software\Policies\Microsoft\Internet Explorer\Main' ; Value = 'DisableFirstRunCustomize' } # Internet Explorer 9 + ) + + foreach ($Key in $RegistryKeys) { + if (-not (Test-Path $Key.Key)) { + New-Item -Path $Key.Key -Force + } + + New-ItemProperty -Path $Key.Key -Name $Key.Value -Value 1 -PropertyType DWORD -Force + } + + Write-Output "IE and Edge first run customizations wizards have been disabled." +}