-
Notifications
You must be signed in to change notification settings - Fork 100
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
(GH-83) Turn off download progress #101
Conversation
Added Check for Choco version and add "--no-progress" to the Params list - Renamed Params variable for consistency across functions - Updated Choco comand execution formatting to be consistent across functions
Adds "[Diagnostics.CodeAnalysis.SuppressMessage('PSAvoidUsingInvokeExpression','')]" to function UninstallPackage, to match other functions that use InvokeExpression to call Chco
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty good, but finding the version of Chocolatey is quite a bit simpler, plus there may be times where (depending on how it was installed) there may not be a Chocolatey nupkg in the lib folder.
The reason I used Get-ChocoInstalledPackage instead of choco -v, is because of the work done with caching the package list, running choco -v 15 times takes about 10.3 seconds, where as running Get-ChocoInstalledPackage takes about 1.6. Pushing that up to 45 repetitions and choco -v is around 30 seconds and Get-ChocoInstalledPackage is still only at 1.8 seconds. I'm sorry I don't know enough about how Choco works to follow what would happen if there were not a "Chocolatey nupkg in the lib folder" would this mean that |
Powershell needs versions to be specified as strings in order to compair them to version numbers. Updated to '0.10.4' insure accurate logic.
It depends on how Chocolatey was installed, but folks are free to install it in their own ways and while we wish everything was a good steward about getting the nupkg in the proper place, that isn't always true. Above that, for the longest time even our scripts were not doing it correctly, so some of the configuration managers out there were also implementing it wrong. So we can't assume that the nupkg is there.
This is a great point. Perhaps cache the version output as well? I think it will be even faster than iterating the cache of installed packages and it will also be more accurate due to the above constraints. Thoughts? |
I would agree, there would be time savings from caching |
Ensured explicitly casting '0.10.4' to Version
I think the timer is going to be fine. |
Added parsing to split on '-' and only use the first section.
@ferventcoder Let me know if there are any other items that need to be addressed before this can be merged. If this is good to go as implemented I can squash it down and correct the commit messages that are inaccurate. |
@ferventcoder Can you take a look at this and see if there is anything else needed since your review? |
Thanks for the bump @pauby would love to get this into into production, would do a lot to clean up logs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jrdnr I've gone through and resolved the conversations by @ferventcoder - just one small point from me, where we can use Advanced Functions. After that I'm happy to give this a spin and merge.
Using `$Purge.IsPresent` to be more explicit.
Fixes Issue #83 "Turn off download progress"
Choco Versions >10.4 overwhelm log with download Progress data
Added Check for Choco version and add "--no-progress" to the Params list