-
-
Notifications
You must be signed in to change notification settings - Fork 105
/
Copy pathEdge.ps1
29 lines (25 loc) · 1.23 KB
/
Edge.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# Download Microsoft Edge Stable x64
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
if ($Host.Version.Major -eq 5)
{
# Progress bar can significantly impact cmdlet performance
# https://github.com/PowerShell/PowerShell/issues/2138
$Script:ProgressPreference = "SilentlyContinue"
}
$Parameters = @{
Uri = "https://edgeupdates.microsoft.com/api/products"
UseBasicParsing = $true
Verbose = $true
}
$LatestStableRelease = ((Invoke-RestMethod @Parameters | Where-Object -FilterScript {$_.Product -eq "Stable"}).Releases | Where-Object -FilterScript {
$_.Platform -eq "Windows"
} | Where-Object -FilterScript {$_.Architecture -eq "x64"} | Select-Object -Index 0).Artifacts.Location
$DownloadsFolder = Get-ItemPropertyValue -Path "HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" -Name "{374DE290-123F-4565-9164-39C4925E467B}"
$Parameters = @{
Uri = $LatestStableRelease
OutFile = "$DownloadsFolder\MicrosoftEdgeEnterpriseX64.msi"
UseBasicParsing = $true
Verbose = $true
}
Invoke-Webrequest @Parameters
Start-Process -FilePath "$DownloadsFolder\MicrosoftEdgeEnterpriseX64.msi" -ArgumentList "/passive /norestart DONOTCREATEDESKTOPSHORTCUT=true"