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

Turn off installation progress for cChocoPackageInstall to stop it filling the verbose log output #175

Open
2 tasks done
rcarpenter79 opened this issue Apr 13, 2023 · 4 comments · May be fixed by #178
Open
2 tasks done

Comments

@rcarpenter79
Copy link

Checklist

  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my request.

Is Your Feature Request Related To A Problem? Please describe.

Yes. Verbose output is a mess when logging installation progress.

cChcocoPackageInstall_Verbose_Output

Describe The Solution. Why is it needed?

Set $ProgressPreferences to 'SilentlyContinue' in InstallPackage before running 'choco install'

Example:
I also corrected a typo in $packageInstallOutput.

    $cmd = "choco install $pName $chocoParams"
    Write-Verbose -Message "Install command: '$cmd'"

    $currentProgressPreference = $ProgressPreference
    $ProgressPreference = 'SilentlyContinue'

    $packageInstallOutput = Invoke-Expression -Command $cmd

    $ProgressPreference = $currentProgressPreference

    Write-Verbose -Message "Package output $packageInstallOutput"

Additional Context

No response

Related Issues

No response

@corbob
Copy link
Member

corbob commented Jul 6, 2023

@rcarpenter79 have you by chance tested this change? I didn't know Chocolatey picked up the ProgressPreference from the invoking PowerShell session. If you've confirmed it works, would you be interested in creating a Pull Request for this change?

If it doesn't work, then you can likely fix it with passing --no-progress to Chocolatey.

@corbob corbob self-assigned this Jul 6, 2023
rcarpenter79 pushed a commit to rcarpenter79/cChoco that referenced this issue Jul 7, 2023
Assigns $env:ChocolateyInstall from the System environment variable if $env:ChocolateyInstal is $null (chocolatey#174)
@rcarpenter79 rcarpenter79 linked a pull request Jul 7, 2023 that will close this issue
10 tasks
@rcarpenter79
Copy link
Author

@corbob I have updated my fork with the upstream changes and merged my changes.
Do you want me to create another merge request now?

@corbob
Copy link
Member

corbob commented Oct 12, 2023

@rcarpenter79 no need to open a new pr, just updating the existing one is sufficient.

@corbob
Copy link
Member

corbob commented Oct 19, 2023

@rcarpenter79 apologies for the delays in getting to look at this. I was looking at the PR today to hopefully merge it, but I'm not able to reproduce the initial issue. When I run in a test environment, the output explicitly says it's calling choco install notepadplusplus --no-progress and so doesn't have any download progress. Could you verify which version of cChoco you're using? It looks like that was added quite a while ago, so I'm not sure how you could be seeing the download progress:

if ((Get-ChocoVersion) -ge [System.Version]('0.10.4')){
$chocoParams += " --no-progress"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants