choco icon indicating copy to clipboard operation
choco copied to clipboard

Add a header row to --limit-output output

Open corbob opened this issue 3 years ago • 1 comments

When you use --limit-output or -r you can pipe the output to ConvertFrom-Csv and provide -Delimiter '|' to get a PowerShell object. In order to get a proper one, you need to also pass in -Header. It would be beneficial to output a header row for the user so they don't need this.

The output I envision for choco list -lo -r would change from:

chocolatey|0.12.1

to (something like):

PackageId|Version
chocolatey|0.12.1`

In order to make this change in a way to not break existing scripts/workflows, I would suggest adding a feature showHeaderOnLimitOutput that defaults to disabled with the possibility of defaulting it to enabled in a future version.

corbob avatar Feb 08 '22 18:02 corbob

I've got some working code on this, I just need to add some tests then I'll put up a PR for this one.

corbob avatar Oct 13 '22 16:10 corbob

:tada: This issue has been resolved in version 2.5.0 :tada:

The release is available on:

Your GitReleaseManager bot :package: :rocket:

choco-bot avatar Jul 09 '25 11:07 choco-bot