1
1
# Stop script execution when a non-terminating error occurs
2
2
$ErrorActionPreference = " Stop"
3
3
4
- # pinned because awscli v2 drops 'aws ecr get-login'
5
- # https://github.com/buildkite-plugins/ecr-buildkite-plugin/issues/37
6
- $AWS_CLI_VERSION = 1.18 .11
7
- $GIT_VERSION = 2.39 .1
4
+ $AWS_CLI_WINDOWS_VERSION = " 2.28.15"
5
+ $GIT_VERSION = " 2.39.1"
8
6
9
7
Write-Output " Installing chocolatey package manager"
10
8
Set-ExecutionPolicy Bypass - Scope Process - Force
@@ -14,8 +12,13 @@ Write-Output "Installing jq"
14
12
choco install - y jq
15
13
If ($lastexitcode -ne 0 ) { Exit $lastexitcode }
16
14
17
- Write-Output " Installing awscli"
18
- choco install - y awscli -- version= $AWS_CLI_VERSION
15
+ Write-Output " Installing AWS CLI v2 $AWS_CLI_WINDOWS_VERSION ..."
16
+ $tempDir = New-TemporaryFile | % { Remove-Item $_ ; New-Item - ItemType Directory - Path $_ }
17
+ $msiPath = Join-Path $tempDir " AWSCLIV2.msi"
18
+ $msiUrl = " https://awscli.amazonaws.com/AWSCLIV2-$AWS_CLI_WINDOWS_VERSION .msi"
19
+ Invoke-WebRequest - Uri $msiUrl - OutFile $msiPath
20
+ Start-Process - FilePath " msiexec.exe" - ArgumentList " /i `" $msiPath `" /quiet" - Wait
21
+ Remove-Item - Recurse - Force $tempDir
19
22
If ($lastexitcode -ne 0 ) { Exit $lastexitcode }
20
23
21
24
Write-Output " Installing Git for Windows"
@@ -42,7 +45,7 @@ Update-SessionEnvironment
42
45
Write-Output " Prepending 'gitinstall\mingw64\bin' and 'gitinstall\usr\bin' to the system's PATH"
43
46
$oldpath = (Get-ItemProperty - Path ' Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' - Name PATH).Path
44
47
$newpath = " C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;$oldpath "
45
- Set-ItemProperty - Path ' Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' - Name PATH - Value $newPath
48
+ Set-ItemProperty - Path ' Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' - Name PATH - Value $newpath
46
49
47
50
# Set autocrlf to false so we don't end up with mismatched line endings
48
51
git config -- system core.autocrlf false
0 commit comments