Skip to content

Commit

Permalink
Expand-Archive progress-bar suppression
Browse files Browse the repository at this point in the history
When running on Windows Server 2019 via SSH this results in `Win32 internal error "Access is denied" 0x5 occurred while reading the console output buffer. Contact Microsoft Customer Support Services.`.

Changes prevent issues with CLI non-interactive execution on Window Server 2019 by suppressing process bar for Expand-Archive command (see: PowerShell/Microsoft.PowerShell.Archive#77)

Tested on Windows Server 2019 & 2022
  • Loading branch information
mvaessen authored Jul 4, 2023
1 parent b5e4123 commit 86af3b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion helpful_tools/Install-DockerCE/install-docker-ce.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -606,8 +606,12 @@ Install-Docker()

Write-Output "Downloading $zipUrl to $destinationFolder\docker-$version.zip"
Copy-File -SourcePath $zipUrl -DestinationPath "$destinationFolder\docker-$version.zip"
Expand-Archive -Path "$destinationFolder\docker-$version.zip" -DestinationPath "$destinationFolder\docker-$version"

#Prevent issues with CLI non-interactive execution on Window Server 2019
$global:ProgressPreference = "SilentlyContinue"
Expand-Archive -Path "$destinationFolder\docker-$version.zip" -DestinationPath "$destinationFolder\docker-$version"
$global:ProgressPreference = "Continue"

if($DockerPath -eq "default") {
$DockerPath = "$destinationFolder\docker-$version\docker\docker.exe"
}
Expand Down

0 comments on commit 86af3b6

Please sign in to comment.