Skip to content

Instantly share code, notes, and snippets.

@EricCote
Created May 23, 2021 04:44
Show Gist options
  • Save EricCote/97a96106db75382e737380e93352d164 to your computer and use it in GitHub Desktop.
Save EricCote/97a96106db75382e737380e93352d164 to your computer and use it in GitHub Desktop.
$edgeEnterpriseMSIUri = 'https://edgeupdates.microsoft.com/api/products?view=enterprise'
$response = Invoke-WebRequest -Uri $edgeEnterpriseMSIUri -Method Get -ContentType "application/json" -UseBasicParsing -ErrorVariable InvokeWebRequestError
$jsonObj = ConvertFrom-Json $([String]::new($response.Content))
$selectedIndex = [array]::indexof($jsonObj.Product, "Stable")
$LatestEdgeUrl = ($jsonObj[$selectedIndex].Releases |
Where-Object { $_.Architecture -eq "x64" -and $_.Platform -eq "Windows"} |
Sort-Object $_.ReleaseId -Descending)[0].Artifacts[0].Location
#download edge
Invoke-WebRequest -Uri $LatestEdgeUrl -OutFile "$env:temp\edge.msi" -UseBasicParsing
#install edge
msiexec /q /i "$env:temp\edge.msi" ALLUSERS=1
#hide first run popups
New-ItemProperty -path "HKLM:\Software\Microsoft\Edge" -name "HideFirstRunExperience" -value 1
#Stop nagging default browser
md HKLM:\Software\Policies\Microsoft\Edge
New-ItemProperty -path "HKLM:\Software\Policies\Microsoft\Edge" -name "DefaultBrowserSettingEnabled" -Value 0
#stop nagging Browser for chrome
md "HKLM:\SOFTWARE\Policies\Google\Chrome" -Force
New-ItemProperty -path "HKLM:\SOFTWARE\Policies\Google\Chrome" -name "DefaultBrowserSettingEnabled" -Value 0
#Show hidden Files
Set-ItemProperty HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced HideFileExt 0
#Set eastern time zone
tzutil /s "Eastern Standard Time"
#enable sound
Set-Service audiosrv -startuptype automatic
start-service audiosrv
#disable new network popup. All new networks are now considered "public"
new-Item HKLM:\System\CurrentControlSet\Control\Network\NewNetworkWindowOff
#Disable IE protection
function Disable-IEESC{
$AdminKey = “HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A7-37EF-4b3f-8CFC-4F3A74704073}”
$UserKey = “HKLM:\SOFTWARE\Microsoft\Active Setup\Installed Components\{A509B1A8-37EF-4b3f-8CFC-4F3A74704073}”
Set-ItemProperty -Path $AdminKey -Name “IsInstalled” -Value 0
Set-ItemProperty -Path $UserKey -Name “IsInstalled” -Value 0
}
Disable-IEESC
#disable ie fist run popups
md 'HKLM:\Software\Microsoft\Internet Explorer'
md 'HKLM:\Software\Microsoft\Internet Explorer\Main'
New-ItemProperty -path "HKLM:\Software\Microsoft\Internet Explorer\Main" -name "DisableFirstRunCustomize" -value 1
#disable server manager at login
Get-ScheduledTask -TaskName "ServerManager" | Disable-ScheduledTask
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment