Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Progress bar does not display correctly when redirecting output in any way #2582

Open
MarcoPeraza opened this issue Oct 9, 2022 · 8 comments
Labels
Area-Output Issue related to CLI output Issue-Bug It either shouldn't be doing this or needs an investigation.
Milestone

Comments

@MarcoPeraza
Copy link

MarcoPeraza commented Oct 9, 2022

Brief description of your issue

winget progress bars become line noise when redirecting to a file (in either cmd.exe or powershell) or when piping to tee or out-default (in powershell). I don't think there's a way to turn off the progress bar, so no way to avoid your terminal and log files getting spammed if you want to save output to a file.

Winget's internal logging functionality is not a solution to this issue. Consider a script that does many things, where running winget is just a small part. You often want to capture the entire output of the script, including the winget output, into a single log file. Having separate logfiles for all winget invocations doesn't really allow that. I often redirect the output of large powershell programs, which might invoke dozens of other scripts and executables along the way.

I guess there's two related issues here:

  • The gibberish being produced on screen and in log files
  • The inability to turn off the progress bar. Would be useful for fully-automated scenarios with logging.

Steps to reproduce

# Save output to log.txt but still display output in terminal
winget install -e Microsoft.PowerToys | tee log.txt 

#  Or just redirect to a file  (cmd.exe _OR_ powershell/pwsh)
winget install -e Microsoft.PowerToys > log.txt

# Curiously, you get the same behavior with out-default, which is supposed to be a no-op
winget install -e Microsoft.PowerToys | Out-Default

Expected behavior

A pretty progress bar in the terminal and/or log files without pages of gibberish.

Actual behavior

ΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  9.00 MB / 83.2 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  33.2 MB / 83.2 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  57.2 MB / 83.2 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆ  81.2 MB / 83.2 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûê  83.2 MB / 83.2 MB

If you are downloading a large file and/or have a slow connection, you can easily have many tens or even hundreds of these lines.

Environment

Windows Package Manager (Preview) v1.4.2161-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.25217.1000
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.2161.0
@ghost ghost added the Needs-Triage Issue need to be triaged label Oct 9, 2022
@MarcoPeraza MarcoPeraza changed the title Progress bar does not display correctly when using Tee-Object in powershell Progress bar does not display correctly when redirecting output in any way Oct 9, 2022
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Oct 10, 2022
@Absoblogginlutely
Copy link

The same issue also occurs with winget -list - not just related to the install packages.

@denelon denelon added this to the v1.5-Client milestone Feb 14, 2023
@denelon denelon modified the milestones: v1.5-Client, v.Next-Client Apr 18, 2023
@Trenly
Copy link
Contributor

Trenly commented Jun 16, 2023

[Policy] Area-Output

@microsoft-github-policy-service microsoft-github-policy-service bot added the Area-Output Issue related to CLI output label Jun 16, 2023
@Andrew-J-Larson
Copy link

Same issue for upgrade as well, very annoying to work with.

@asheroto
Copy link

Here is the workaround I came up with. Not perfect, but it works until the spinner / progress bar can be turned off.

This method streams output in real-time, eliminating the wait to view results until after command completion.

function Strip-Progress {
    param(
        [ScriptBlock]$ScriptBlock
    )

    # regex pattern to match spinner characters and progress bar patterns
    $pattern = 'Γû[Æê]|[-\\|/]'

    # Execute the script block and process its output
    & $ScriptBlock 2>&1 | ForEach-Object {
        if ($_ -is [System.Management.Automation.ErrorRecord]) {
            # Output error records
            "ERROR: $($_.Exception.Message)"
        } elseif ($_ -notmatch '^\s*$') {
            # Process non-empty lines
            $line = $_ -replace $pattern, ''
            if (-not [string]::IsNullOrWhiteSpace($line)) {
                $line
            }
        }
    }
}

Usage with Microsoft.WindowsTerminal:

PS C:\Users\Administrator\desktop> Strip-Progress -ScriptBlock { winget install Microsoft.WindowsTerminal --accept-package-agreements --accept-source-agreements --force|tee output.txt }
Found Windows Terminal [Microsoft.WindowsTerminal] Version 1.19.10302.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, thirdparty packages.
This package requires the following dependencies:
   Packages
      Microsoft.UI.Xaml.2.8 [>= 8.2306.22001.0]
Successfully verified installer hash
Starting package install...
    2%
    2%
    48%
    95%
    95%
    95%
    97%
    97%
    100%
Successfully installed
PS C:\Users\Administrator\desktop>

Issue related to feature request on issue #3494.

@Andrew-J-Larson
Copy link

Andrew-J-Larson commented Feb 15, 2024

@asheroto, nicely done, I think I know one little thing to make it better (removes just the spinner symbols rather than the spinner symbols located everywhere):

$pattern = 'Γû[Æê]|^\s+[-\\|/]\s+$'

And here's how that looks now when updating GIMP:

PS C:\Users\Andrew> Strip-Progress -ScriptBlock { winget update GIMP.GIMP --accept-package-agreements --accept-source-agreements --force }
Found GIMP [GIMP.GIMP] Version 2.10.36
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.gimp.org/gimp/v2.10/windows/gimp-2.10.36-setup.exe
    1024 KB /  305 MB
    13.0 MB /  305 MB
    23.0 MB /  305 MB
    33.0 MB /  305 MB
    43.0 MB /  305 MB
    53.0 MB /  305 MB
    64.0 MB /  305 MB
    75.0 MB /  305 MB
    86.0 MB /  305 MB
    97.0 MB /  305 MB
     106 MB /  305 MB
     112 MB /  305 MB
     122 MB /  305 MB
     132 MB /  305 MB
     142 MB /  305 MB
     153 MB /  305 MB
     164 MB /  305 MB
     173 MB /  305 MB
     183 MB /  305 MB
     194 MB /  305 MB
     205 MB /  305 MB
     215 MB /  305 MB
     225 MB /  305 MB
     236 MB /  305 MB
     247 MB /  305 MB
     258 MB /  305 MB
     269 MB /  305 MB
     279 MB /  305 MB
     288 MB /  305 MB
     297 MB /  305 MB
     305 MB /  305 MB
     305 MB /  305 MB
Successfully verified installer hash
Starting package install...
Successfully installed

@Andrew-J-Larson
Copy link

Andrew-J-Larson commented Feb 15, 2024

Here's the code with the modification I made + an additional one that retains newlines (except the beginning ones:

function Strip-Progress {
    param(
        [ScriptBlock]$ScriptBlock
    )

    # regex pattern to match spinner characters and progress bar patterns
    $pattern = 'Γû[Æê]|^\s+[-\\|/]\s+$'

    $firstTextLinePast = $false # skips over empty lines that start the output

    # Execute the script block and process its output
    & $ScriptBlock 2>&1 | ForEach-Object {
        if ($_ -is [System.Management.Automation.ErrorRecord]) {
            # Output error records
            "ERROR: $($_.Exception.Message)"
        } elseif ($_ -notmatch '^\s*$') {
            # Process non-empty lines
            $line = $_ -replace $pattern, ''
            if (-not [string]::IsNullOrWhiteSpace($line)) {
                $firstTextLinePast = $true
                $line
            }
        } elseif ($firstTextLinePast) {
          # don't forget to put original empty lines back in
          Write-Host
        }
    }
}

Which results in output like this:

PS C:\Users\Andrew> Strip-Progress -ScriptBlock { winget update }
Name                                         Id                                Version          Available        Source
-----------------------------------------------------------------------------------------------------------------------
Google Chrome                                Google.Chrome                     121.0.6167.162   122.0.6261.39    winget
Dev Home                                     Microsoft.DevHome                 0.1000.389.0     0.1001.389.0     winget
Microsoft 365 Apps for enterprise - en-us    Microsoft.Office                  16.0.17029.20140 16.0.17126.20132 winget
Microsoft Windows Desktop Runtime - 7.0.15 … Microsoft.DotNet.DesktopRuntime.7 7.0.15           7.0.16           winget
RealVNC Viewer 7.6.1                         RealVNC.VNCViewer                 7.6.1.50931      7.8.0            winget
Microsoft Windows Desktop Runtime - 6.0.26 … Microsoft.DotNet.DesktopRuntime.6 6.0.26           6.0.27           winget
7 upgrades available.

The following packages have an upgrade available, but require explicit targeting for upgrade:
Name                         Id              Version    Available            Source
-----------------------------------------------------------------------------------
Teams Machine-Wide Installer Microsoft.Teams 1.6.0.4472 23320.3027.2591.1505 winget

@asheroto
Copy link

asheroto commented Feb 15, 2024

@Andrew-J-Larson looks great!

Now this is probably overkill, but I noticed a few details I missed before:

  1. Although removing extra lines can be beneficial, we may want to leave at least one extra life if it exists for readability. If we leave all empty lines, though, it's too much space. Since it's unlikely people will want more than one empty line, I added some code to ensure there is a max of one empty line if applicable.
  2. There is an extra space after the slash for packages when installing via winget (example 269 MB / 305 MB). Added another regex pattern to detect the download progress pattern and reformat it. I don't think it will cause any issues with non-winget-related text, as I doubt anyone would want two spaces after a slash in the pattern defined in the code even unrelated to winget. This particular code looks for two decimal points, although that might need to be changed; I didn't want to sway too far away and match unnecessary text.
  3. I removed Write-Host because it could break the output pipeline with certain commands, as it's intended for use to write to the host window itself, not necessarily the output stream. More info
function Strip-Progress {
    param(
        [ScriptBlock]$ScriptBlock
    )

    # Regex pattern to match spinner characters and progress bar patterns
    $progressPattern = 'Γû[Æê]|^\s+[-\\|/]\s+$'

    # Corrected regex pattern for size formatting, ensuring proper capture groups are utilized
    $sizePattern = '(\d+(\.\d{1,2})?)\s+(B|KB|MB|GB|TB|PB) /\s+(\d+(\.\d{1,2})?)\s+(B|KB|MB|GB|TB|PB)'

    $previousLineWasEmpty = $false # Track if the previous line was empty

    & $ScriptBlock 2>&1 | ForEach-Object {
        if ($_ -is [System.Management.Automation.ErrorRecord]) {
            "ERROR: $($_.Exception.Message)"
        } elseif ($_ -match '^\s*$') {
            if (-not $previousLineWasEmpty) {
                Write-Output ""
                $previousLineWasEmpty = $true
            }
        } else {
            $line = $_ -replace $progressPattern, '' -replace $sizePattern, '$1 $3 / $4 $6'
            if (-not [string]::IsNullOrWhiteSpace($line)) {
                $previousLineWasEmpty = $false
                $line
            }
        }
    }
}

Using this code and your command usage...

Before

   - 
   \ 
                                                                                                                        
Found GIMP [GIMP.GIMP] Version 2.10.36
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.gimp.org/gimp/v2.10/windows/gimp-2.10.36-setup.exe

   - 
   \ 
   | 
   / 
                                                                                                                        

  ΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  3.00 MB /  305 MB
  ΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  10.0 MB /  305 MB
  ΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  24.0 MB /  305 MB
  ΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  40.0 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  52.0 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  59.0 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  60.0 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  68.0 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  76.0 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  84.0 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ  95.0 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   104 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   115 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   122 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   136 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   145 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   156 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   169 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   178 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   192 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   203 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   214 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   224 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   231 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   240 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆΓûÆ   247 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆΓûÆ   255 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆΓûÆ   265 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆ   275 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆΓûÆΓûÆ   284 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûÆ   295 MB /  305 MB
  ΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûêΓûê   305 MB /  305 MB
Successfully verified installer hash
Starting package install...

   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
   | 
   / 
   - 
   \ 
                                                                                                                        
Successfully installed

After

PS C:\Users\Administrator\desktop> Strip-Progress -ScriptBlock { winget install GIMP.GIMP --accept-package-agreements --accept-source-agreements --force | tee output.txt }

Found GIMP [GIMP.GIMP] Version 2.10.36
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download.gimp.org/gimp/v2.10/windows/gimp-2.10.36-setup.exe

    0.00 B / 305 MB
    9.00 MB / 305 MB
    16.0 MB / 305 MB
    26.0 MB / 305 MB
    38.0 MB / 305 MB
    47.0 MB / 305 MB
    54.0 MB / 305 MB
    62.0 MB / 305 MB
    74.0 MB / 305 MB
    83.0 MB / 305 MB
    92.0 MB / 305 MB
     100 MB / 305 MB
     109 MB / 305 MB
     118 MB / 305 MB
     128 MB / 305 MB
     139 MB / 305 MB
     150 MB / 305 MB
     157 MB / 305 MB
     165 MB / 305 MB
     174 MB / 305 MB
     180 MB / 305 MB
     188 MB / 305 MB
     198 MB / 305 MB
     210 MB / 305 MB
     224 MB / 305 MB
     238 MB / 305 MB
     245 MB / 305 MB
     255 MB / 305 MB
     261 MB / 305 MB
     268 MB / 305 MB
     274 MB / 305 MB
     283 MB / 305 MB
     294 MB / 305 MB
     304 MB / 305 MB
     305 MB / 305 MB
Successfully verified installer hash
Starting package install...

Successfully installed
PS C:\Users\Administrator\desktop>

Thoughts?

@Andrew-J-Larson
Copy link

Yeah now it's looking pretty great!

Andrew-J-Larson added a commit to Andrew-J-Larson/OS-Scripts that referenced this issue Feb 16, 2024
WinGet output more cleaned up now, thanks to @asheroto in microsoft/winget-cli#2582 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Output Issue related to CLI output Issue-Bug It either shouldn't be doing this or needs an investigation.
Projects
None yet
Development

No branches or pull requests

6 participants