Skip to content

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

Open
@Cyber1000

Description

@Cyber1000

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!

Metadata

Metadata

Assignees

Labels

3 - ReviewHas related issueThis issue has a related issue that would need to be addressed before this issue could be closed.Improvement

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions