Open MickaelRoy opened 1 year ago
We are unable to reproduce these steps without mypackage
. Can you provide:
mypackage
Note that --no-progress
only does not show the download progress percentages bar. From choco instal -?
:
--no-progress
Do Not Show Progress - Do not show download progress percentages.
you can find the package here https://github.com/MickaelRoy/Chocolatey Gist has been updated with log generated fron another/similar host.
I know that --no-progress concerns download process. this is why I raise this bug. the package don't need anything else than executing a command from scheduledtasks module to trigger this useless information.
I observe this issue no metter on Server and desktop OS edition.
Can you provide a screenshot of the useless information?
The gist provides the word 'progress' twice, and neither of them are the message you mention.
Sorry, it seems that i'm not clear.... the screenshot is right beside the package you asked. https://github.com/MickaelRoy/Chocolatey/blob/main/2023-09-22_14h06_10.png
So I can reproduce this issue but it appears to be coming from Get-ScheduledTask
rather than ChocolateyCLI. I amend the chocolateyInstall.ps1
from the package to add this:
Write-Warning "Before"
$PostInstallTask = Get-ScheduledTask -TaskName 'Citrix VDA post installation' -TaskPath \ -ea 0 -InformationAction SilentlyContinue
Write-Warning "After"
Get-ScheduledTask -TaskName 'Citrix VDA post installation' -TaskPath \ -ea 0 -InformationAction SilentlyContinue
Write-Warning "After Again 1"
$abc = Get-ScheduledTask -TaskName 'Citrix VDA post installation' -TaskPath \ -ea 0 -InformationAction SilentlyContinue
Write-Warning "After Again 2"
(Note that the rest of that script didn't change). I then ran choco install mypackage -vd
and got this:
Which shows that the Progress 100% (1/1)
is coming from that cmdlet rather than Chocolatey CLI.
Running choco install mypackage -vd --no-progress
does show:
Which means either Chocolatey CLI is identifying the text and consuming it (perhaps because it contains the word 'Progress') or we have special handling for that cmdlet which I don't think we do and cannot find.
Having said all of that, if you run Get-ScheduledTask -TaskName 'Citrix VDA post installation' -TaskPath \ -ea 0 -InformationAction SilentlyContinue
, you get:
(i.e. none of the text we saw above).
My workaround, for now, would be to run it with --no-progress
as you identified.
So I'm a little confused.
As an update, if you run choco install mypackage --use-system-powershell
it works as expected, so it's in the PowerShell host that Chocolatey CLI spins up:
so am I (confused)
putting each time --no-progress is a little boring. it should be great to get a variable of something to put directly in the chocolatey(un)intall.ps1
I don't understand what those cmdlets do to trigger {choco download progress detection} but the legacy command SchTasks.exe looks not concerned by this behaviour.
Edit. Ok this last point is explained by your last comment about --use-system-powershell, dos command is not concerned by powershell drifts
See the comment I left above. The issue is in the PowerShell host that Chocolatey CLI creates to run the PowerShell script. The workaround, until the bug is fixed, is to add either --no-progress
or --use-system-powershell
. Both of those remove the text that you don't want.
Checklist
What You Are Seeing?
Whether Chocolateuinstall.ps1 contains any cmdlets regarding ScheduledTasks powershell module, Choco.exe detects it as a download process and show "Progress: 100% - 1/1 completed"
The issue disappear if I run with --no-progress parameter.
What is Expected?
Nothing is expected, that's the point
How Did You Get This To Happen?
I ran choco instal mypackage chocolateyinstall.ps1 contains
$PostInstallTask = Get-ScheduledTask -TaskName 'Citrix VDA post installation' -TaskPath \ -ea 0 -InformationAction SilentlyContinue
Progress: 100% - 1/1 completedSystem Details
Installed Packages
Output Log
Additional Context
No response