diff --git a/Dockerfile.windows b/Dockerfile.windows index e2f37a73..6a268eb6 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -3,6 +3,13 @@ FROM mcr.microsoft.com/windows/servercore:ltsc2022 # Reset the shell. SHELL ["cmd", "/S", "/C"] +# install powershell core +RUN powershell Invoke-WebRequest -Uri https://github.com/PowerShell/PowerShell/releases/download/v7.4.2/PowerShell-7.4.2-win-x64.msi -OutFile $env:TEMP\powershell.msi ; \ + Start-Process -Wait -FilePath msiexec.exe -ArgumentList '/i', '$env:TEMP\powershell.msi', '/quiet', '/norestart' ; \ + Remove-Item $env:TEMP\powershell.msi -Force +ENV PATH="${PATH};C:\Windows\System32\WindowsPowerShell\v1.0" + + # download and install vs build tools needed by vcpkg RUN powershell -Command \ Invoke-WebRequest -Uri https://aka.ms/vs/17/release/channel -OutFile $env:TEMP\VisualStudio.chman; \ @@ -14,7 +21,9 @@ RUN powershell -Command \ "--add", "Microsoft.VisualStudio.Component.VC.Tools.x86.x64", \ "--add", "Microsoft.Component.MSBuild", \ "--add", "Microsoft.VisualStudio.Component.Windows11SDK.22621", \ - "--includeRecommended"; + "--includeRecommended"; \ + Remove-Item $env:TEMP\VisualStudio.chman -Force; \ + Remove-Item $env:TEMP\vs_buildtools.exe -Force # install git RUN powershell -Command \