How to get a list of packages from one machine and install in another with Chocolatey?

前端 未结 6 2031
迷失自我
迷失自我 2021-01-31 08:23

Calling clist -l gives me a list of packages with versions:

7zip.install 16.04
ccleaner 5.28.6005
ConEmu 17.3.16.0
...

How do I ge

6条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 09:10

    Here is how I generated my packages.config:

    $packageXml = ''
    choco list -lo -r | % { $_ -split '\|' | select -first 1 } | % { $packageXml += "`n`t" }
    Set-Content "`n$packageXml`n" -Path .\packages.config
    

    Once you have that, you take that file to the other machine and do:

    choco install packages.config
    

提交回复
热议问题