From 6337bc0a3cba7463123add7c2237b8d940311713 Mon Sep 17 00:00:00 2001 From: Igor Sarkisov Date: Tue, 7 Nov 2023 10:47:55 -0800 Subject: [PATCH] Add ErrorAction to Win Dockerfiles. (#1919) b/309502154 --- docker/windows/base/build/Dockerfile | 3 ++- docker/windows/base/visualstudio2022/Dockerfile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/windows/base/build/Dockerfile b/docker/windows/base/build/Dockerfile index 2b2de4ddbaf5..9c53d77613d7 100644 --- a/docker/windows/base/build/Dockerfile +++ b/docker/windows/base/build/Dockerfile @@ -16,7 +16,8 @@ ARG FROM_IMAGE FROM ${FROM_IMAGE} -SHELL ["powershell", "-ExecutionPolicy", "unrestricted", "-Command"] +SHELL ["powershell", "-ExecutionPolicy", "Unrestricted", "-Command", ` + "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # Helper script for quick delete operations in windows COPY ./fast-win-rmdir.cmd /fast-win-rmdir.cmd diff --git a/docker/windows/base/visualstudio2022/Dockerfile b/docker/windows/base/visualstudio2022/Dockerfile index d8be00b238a9..cc6bdae6d69b 100644 --- a/docker/windows/base/visualstudio2022/Dockerfile +++ b/docker/windows/base/visualstudio2022/Dockerfile @@ -19,7 +19,8 @@ FROM ${FROM_IMAGE} # Dockerfile for image used to install Visual Studio. # WARNING: Changes to this file will result in an extremely long image rebuild. -SHELL ["powershell", "-ExecutionPolicy", "unrestricted", "-Command"] +SHELL ["powershell", "-ExecutionPolicy", "Unrestricted", "-Command", ` + "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] RUN mkdir C:\TEMP;` Write-Host ('Downloading vs_buildtools.exe');`