diff --git a/packer/scripts/windows/scoop-setup.ps1 b/packer/scripts/windows/scoop-setup.ps1 index e52c7fc6..56b0bb42 100644 --- a/packer/scripts/windows/scoop-setup.ps1 +++ b/packer/scripts/windows/scoop-setup.ps1 @@ -9,7 +9,12 @@ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # Install Scoop as Administrator User here -iex "& {$(irm get.scoop.sh)} -RunAsAdmin" +# Scoop version >= 0.5.0 has error with Select-CurrentVersion function +# They have not fix the issue and will error out on Windows ltsc2019 +# https://github.com/ScoopInstaller/Scoop/issues/6180 +# A temp solution is to hardcode the scoop version to 0.4.2 +# iex "& {$(irm get.scoop.sh)} -RunAsAdmin" +iex "& {$(irm https://raw.githubusercontent.com/peterzhuamazon/scoop-Install/refs/heads/stable/install.ps1)} -RunAsAdmin" # Disable "current" alias directory as it is not preserved after AMI creation # Use static path in environment variable