chocolatey / chocolatey/choco

Add option to include pinned-state in the choco export command

Open
#2,603 5 comments 2 reactions 1 assignee Claimed by @TheCakeIsNaOH View on GitHub
3 - Review Enhancement Has Dependency
Dominant language
C#
Stars
11.5k
Forks
960
PR merge metrics
No merged PRs in 30d

Description

Similar to #2503 where install-args are included in export-file, I would like to have pinned-state included in export.
I'm aware that pinned state isn't known at install time, but it would be helpful to get the same state on a new computer as before.

For now I'm helping myself without "choco export" (I've using this longer than "choco export" exists):
> (choco pin -y |%{$_ -replace '(.+?)\|(.+)','choco install $1 --version $2'} | select -Skip 1) >C:\Backup\choco.install.ps1
(choco pin -y |%{$_ -replace '(.+?)\|.+','choco pin add -n=''$1'''} | select -Skip 1)>>C:\Backup\choco.install.ps1
"choco install -y",[string]::Join(" ", (clist -l -r |%{$_ -replace '(.+?)\|.+','$1'} | select)) -join " " >>C:\Backup\choco.install.ps1

- first line writes install command for all pinned packages
- second line writes a "pin" for all pinned packages
- third line writes rest of packages
- On new computer I just have to execute C:\Backup\choco.install.ps1 (I don't have special install arguments, pins where more important to me)

Would be nice if choco implements an export fully (with pins).
Thanks!

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.