2023-12-14 18:03:19 +00:00
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
|
$ProgressPreference = "SilentlyContinue"
|
2024-05-07 10:19:58 +00:00
|
|
|
$GoMsiVersion = "go1.22.2.windows-amd64.msi"
|
|
|
|
|
2023-12-14 18:03:19 +00:00
|
|
|
Write-Output "Downloading go installer..."
|
2024-05-07 10:19:58 +00:00
|
|
|
|
2023-12-14 18:03:19 +00:00
|
|
|
Set-Location "$Env:Temp"
|
2024-05-07 10:19:58 +00:00
|
|
|
|
2023-12-14 18:03:19 +00:00
|
|
|
(New-Object System.Net.WebClient).DownloadFile(
|
|
|
|
"https://go.dev/dl/$GoMsiVersion",
|
|
|
|
"$Env:Temp\$GoMsiVersion"
|
|
|
|
)
|
2024-05-07 10:19:58 +00:00
|
|
|
|
2023-12-14 18:03:19 +00:00
|
|
|
Write-Output "Installing go..."
|
|
|
|
Install-Package "$Env:Temp\$GoMsiVersion" -Force
|
2024-05-07 10:19:58 +00:00
|
|
|
|
2023-12-14 18:03:19 +00:00
|
|
|
# Go installer updates global $PATH
|
|
|
|
go env
|
2024-05-07 10:19:58 +00:00
|
|
|
|
2023-12-14 18:03:19 +00:00
|
|
|
Write-Output "Installed"
|