Downloads:
138,236
Downloads of v 2018.04.24:
349
Last Update:
24 Apr 2018
Package Maintainer(s):
Software Author(s):
- Bill Curran
Tags:
bcurran3 choco unofficial package packages.config backup script- Software Specific:
- Software Site
- Software Source
- Software License
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
(unofficial) Choco Package List Backup to Local and Cloud (Script)
This is not the latest version of (unofficial) Choco Package List Backup to Local and Cloud (Script) available.
- 1
- 2
- 3
2018.04.24 | Updated: 24 Apr 2018
- Software Specific:
- Software Site
- Software Source
- Software License
- Software Issues
- Package Specific:
- Package Source
- Package outdated?
- Package broken?
- Contact Maintainers
- Contact Site Admins
- Software Vendor?
- Report Abuse
- Download
Downloads:
138,236
Downloads of v 2018.04.24:
349
Maintainer(s):
Software Author(s):
- Bill Curran
(unofficial) Choco Package List Backup to Local and Cloud (Script) 2018.04.24
This is not the latest version of (unofficial) Choco Package List Backup to Local and Cloud (Script) available.
- 1
- 2
- 3
All Checks are Passing
3 Passing Tests
Deployment Method: Individual Install, Upgrade, & Uninstall
To install (unofficial) Choco Package List Backup to Local and Cloud (Script), run the following command from the command line or from PowerShell:
To upgrade (unofficial) Choco Package List Backup to Local and Cloud (Script), run the following command from the command line or from PowerShell:
To uninstall (unofficial) Choco Package List Backup to Local and Cloud (Script), run the following command from the command line or from PowerShell:
Deployment Method:
This applies to both open source and commercial editions of Chocolatey.
1. Enter Your Internal Repository Url
(this should look similar to https://community.chocolatey.org/api/v2/)
2. Setup Your Environment
1. Ensure you are set for organizational deployment
Please see the organizational deployment guide
2. Get the package into your environment
Option 1: Cached Package (Unreliable, Requires Internet - Same As Community)-
Open Source or Commercial:
- Proxy Repository - Create a proxy nuget repository on Nexus, Artifactory Pro, or a proxy Chocolatey repository on ProGet. Point your upstream to https://community.chocolatey.org/api/v2/. Packages cache on first access automatically. Make sure your choco clients are using your proxy repository as a source and NOT the default community repository. See source command for more information.
- You can also just download the package and push it to a repository Download
-
Open Source
-
Download the package:
Download - Follow manual internalization instructions
-
-
Package Internalizer (C4B)
-
Run: (additional options)
choco download choco-package-list-backup --internalize --version=2018.04.24 --source=https://community.chocolatey.org/api/v2/
-
For package and dependencies run:
choco push --source="'INTERNAL REPO URL'"
- Automate package internalization
-
Run: (additional options)
3. Copy Your Script
choco upgrade choco-package-list-backup -y --source="'INTERNAL REPO URL'" --version="'2018.04.24'" [other options]
See options you can pass to upgrade.
See best practices for scripting.
Add this to a PowerShell script or use a Batch script with tools and in places where you are calling directly to Chocolatey. If you are integrating, keep in mind enhanced exit codes.
If you do use a PowerShell script, use the following to ensure bad exit codes are shown as failures:
choco upgrade choco-package-list-backup -y --source="'INTERNAL REPO URL'" --version="'2018.04.24'"
$exitCode = $LASTEXITCODE
Write-Verbose "Exit code was $exitCode"
$validExitCodes = @(0, 1605, 1614, 1641, 3010)
if ($validExitCodes -contains $exitCode) {
Exit 0
}
Exit $exitCode
- name: Install choco-package-list-backup
win_chocolatey:
name: choco-package-list-backup
version: '2018.04.24'
source: INTERNAL REPO URL
state: present
See docs at https://docs.ansible.com/ansible/latest/modules/win_chocolatey_module.html.
chocolatey_package 'choco-package-list-backup' do
action :install
source 'INTERNAL REPO URL'
version '2018.04.24'
end
See docs at https://docs.chef.io/resource_chocolatey_package.html.
cChocoPackageInstaller choco-package-list-backup
{
Name = "choco-package-list-backup"
Version = "2018.04.24"
Source = "INTERNAL REPO URL"
}
Requires cChoco DSC Resource. See docs at https://github.com/chocolatey/cChoco.
package { 'choco-package-list-backup':
ensure => '2018.04.24',
provider => 'chocolatey',
source => 'INTERNAL REPO URL',
}
Requires Puppet Chocolatey Provider module. See docs at https://forge.puppet.com/puppetlabs/chocolatey.
4. If applicable - Chocolatey configuration/installation
See infrastructure management matrix for Chocolatey configuration elements and examples.
This package was approved as a trusted package on 24 Apr 2018.
choco-package-list-backup.ps1 solves your Chocolatey migration and package re-installation problems!
choco-package-list-backup.ps1 is a script I wrote that will backup the list of your currently installed Chocolatey packages and save them to a PACKAGES.CONFIG file. You can then use that PACKAGES.CONFIG file to re-install all your packages on another computer or even the same computer later if it crashes. "How can I re-install on the same computer if it crashed and I lost the PACKAGES.CONFIG file?" Thanks for asking! choco-package-list-backup.ps1 backs up your package list locally and to multiple cloud services!
Features:
choco-package-list-backup.ps1 supports saving PACKAGES.CONFIG to all of the following:
- your local Documents folder
- your Active Directory assigned HOMESHARE
- Box (new 2018-02-24)
- Dropbox
- Google Drive
- Microsoft OneDrive
- NETGEAR ReadyCLOUD
- Nextcloud
- Resilio Sync
- Seafile (new 2018-02-24)
- TonidoSync
- A custom location of your choice
- more coming - Let me know what you want/need!
choco-package-list-backup.ps1 runs on install to make sure you have backup(s) right now! (new 2018-04-23)
choco-package-list-backup.ps1 supports backing up persistentpackages.config if you are using choco-persistent-packages (new 2018-04-24)
choco-package-list-backup.ps1 saves in computer (name) specific folders so you can backup your Chocolatey package list from multiple computers to the same cloud destination(s). No confusion over what computer gets what packages!
choco-package-list-backup.ps1 is configurable. You can:
- configure which locations you want or don't want to save to (default=all the locations found except the custom location)
- configure to save package version information or not (default=False)
- configure what subfolder to save to (default=ChocolateyPackageListBackup)
- easily add a custom location by editing $CustomPath and $UseCustomPath in the script
choco-package-list-backup.ps1 is saved to the Chocolatey's bin folder (\ProgramData\chocolatey\bin), so it's in your path.
choco-package-list-backup.ps1 supports copying InstChoco with the PACKAGES.CONFIG path for the fastest way ever to reinstall Chocolatey and your Chocolatey packages! (Or migrate!)
choco-package-list-backup.ps1 instructions:
- Edit \ProgramData\chocolatey\bin\choco-package-list-backup.ps1 to customize your backup(s). It's easy, there are comments.
- From PowerShell, type CHOCO-PACKAGE-LIST-BACKUP.PS1 to backup your Chocolatey packages list.
- From Command Prompt, type POWERSHELL CHOCO-PACKAGE-LIST-BACKUP.PS1 to backup your Chocolatey packages list.
- From Windows, click Choco Package List Backup in the Start menu (new 2018-02-24)
Use choco-package-list-backup.ps1 along with ForcePS for easy execution and InstChoco for a complete backup and recovery solution of your Chocolatey packages.
If you find choco-package-list-backup.ps1 useful, and I suspect you will, please consider donating: https://www.paypal.me/bcurran3donations
@echo off
net session >nul 2>&1
if %errorLevel% == 0 goto RunScript
else (
color 4e
cls
echo.
echo ********************************************
echo * You must choose "Run as administrator" *
echo ********************************************
echo.
timeout 5
goto end
)
:RunScript
powershell -NoProfile -ExecutionPolicy Bypass -Command "\ProgramData\chocolatey\bin\choco-package-list-backup.ps1"
:end
# choco-package-list-backup.ps1 (to local and cloud) by Bill Curran
# I couldn't have done this without the list parsing from Ammaar Limbada found at https://gist.github.com/alimbada/449ddf65b4ef9752eff3
# LICENSE: GNU GPL v3 - https://www.gnu.org/licenses/gpl.html
# ROADMAP:
# Add ability to use a different source other than the Chocolatey public repository
# Add other cloud services support by request
# Add appended date/time option
# Open to suggestions - open a GitHub issue please if you have a suggestion/request.
# CAN NOT save/get installed package parameters as they are encrypted :(
$CPLBver = "2018.04.24" # Version of this script
$ConfigFile = "packages.config"
$SaveFolderName = "ChocolateyPackageListBackup" # Change the subfolder name if you don't like my default
$SaveVersions = "False" # Specify if you want to save specific version info or not
$InstChoco = "$Env:ChocolateyInstall\lib\instchoco\tools\InstChoco.exe" # location of InstChoco.exe if it exists
$CustomPath = "c:\install" # Edit to save to a special location of your choice
# Toggle True/False if you want to backup/not backup to the locations below
$UseCustomPath = "False" # Change to True if you are using $CustomPath
$UseDocuments = "True"
$UseHomeShare = "True" # Domain joined computers HOMEDRIVE support
$UseBox = "True"
$UseDropbox = "True"
$UseGoogleDrive = "True"
$UseNextcloud = "True"
$UseOneDrive = "True"
$UseReadyCLOUD = "True"
$UseResilioSync = "True"
$UseSeafile = "True"
$UseTonidoSync = "True"
# Check the path to save packages.config and create if it doesn't exist
Function Check-SaveLocation{
$CheckPath = Test-Path $SavePath
If ($CheckPath -match "False")
{
New-Item $SavePath -Type Directory -force | out-null
}
}
# Copy persistentpackages.config if it exists to the same location as packages.config
Function Check-PPConfig{
$CheckPPSource = Test-Path $Env:ChocolateyInstall\config\persistentpackages.config
If ($CheckPPSource -match "True"){
Copy-Item $Env:ChocolateyInstall\config\persistentpackages.config $SavePath -force | out-null
Write-Host "$SavePath\persistentpackages.config SAVED!" -ForegroundColor green
}
}
# Copy InstChoco.exe if it exists to the same location as packages.config for super duper easy re-installation
Function Check-InstChoco{
$CheckICSource = Test-Path $InstChoco
If ($CheckICSource -match "True"){
$CheckICDest = Test-Path $SavePath\InstChoco.exe
If ($CheckICDest -match "False")
{
Copy-Item $InstChoco $SavePath -force | out-null
Write-Host "$SavePath\InstChoco.exe SAVED!" -ForegroundColor green
} else {
# copying even if it already exists to ensure current version - may put flag in future InstChoco version to determine if upgraded
Copy-Item $InstChoco $SavePath -force | out-null
}
}
}
# Write out the saved list of packages to packages.config
Function Write-PackageConfig{
Check-SaveLocation
Check-PPConfig
Check-InstChoco
Write-Output "<?xml version=`"1.0`" encoding=`"utf-8`"?>" >"$SavePath\$ConfigFile"
Write-Output "<packages>" >>"$SavePath\$ConfigFile"
if ($SaveVersions -match "True")
{
choco list -lo -r -y | % { " <package id=`"$($_.SubString(0, $_.IndexOf("|")))`" version=`"$($_.SubString($_.IndexOf("|") + 1))`" />" }>>"$SavePath\$ConfigFile"
} else {
choco list -lo -r -y | % { " <package id=`"$($_.SubString(0, $_.IndexOf("|")))`" />" }>>"$SavePath\$ConfigFile"
}
Write-Output "</packages>" >>"$SavePath\$ConfigFile"
Write-Host "$SavePath\$ConfigFile SAVED!" -ForegroundColor green
}
Write-Host "choco-package-list-backup.ps1 v$CPLBver" - backup Chocolatey package list(s) locally and to the cloud -ForegroundColor white
Write-Host "Copyleft 2018 Bill Curran ([email protected]) - free for personal and commercial use" -ForegroundColor white
# Backup Chocolatey package names to packages.config file in custom defined path you set in $CustomPath above in line 16
if ($UseCustomPath -match "True" -and (Test-Path $CustomPath))
{
$SavePath = "$CustomPath\$SaveFolderName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in the Documents folder
if ($UseDocuments -match "True" -and (Test-Path $Env:USERPROFILE\Documents))
{
$SavePath = "$Env:USERPROFILE\Documents\$SaveFolderName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in Box (Sync) directory if it exists
if ($UseBox -match "True" -and (Test-Path "$Env:USERPROFILE\Box Sync"))
{
$SavePath = "$Env:USERPROFILE\Box Sync\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in Dropbox directory if it exists
if ($UseDropbox -match "True" -and (Test-Path $Env:USERPROFILE\Dropbox))
{
$SavePath = "$Env:USERPROFILE\Dropbox\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in Google Drive directory if it exists
if ($UseGoogleDrive -match "True" -and (Test-Path "$Env:USERPROFILE\Google Drive"))
{
$SavePath = "$Env:USERPROFILE\Google Drive\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file on your HOMESHARE directory if it exists
#if ($UseHomeShare -match "True" -and (Test-Path "$Env:HOMESHARE" -eq "True"))
$ExistHomeShare = (Test-Path "Env:HOMESHARE")
if ($UseHomeShare -match "True" -and $ExistHomeShare -match "True")
{
$SavePath = "$Env:HOMESHARE\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in Nextcloud directory if it exists
if ($UseNextcloud -match "True" -and (Test-Path $Env:USERPROFILE\Nextcloud))
{
$SavePath = "$Env:USERPROFILE\Nextcloud\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in OneDrive directory if it exists
if ($UseOneDrive -match "True" -and (Test-Path $Env:USERPROFILE\OneDrive))
{
$SavePath = "$Env:USERPROFILE\OneDrive\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in Netgear ReadyCLOUD directory if it exists
if ($UseReadyCLOUD -match "True" -and (Test-Path $Env:USERPROFILE\ReadyCLOUD))
{
$SavePath = "$Env:USERPROFILE\ReadyCLOUD\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in Resilio Sync directory if it exists
if ($UseResilioSync -match "True" -and (Test-Path "$Env:USERPROFILE\Resilio Sync"))
{
$SavePath = "$Env:USERPROFILE\Resilio Sync\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in Seafile directory if it exists
if ($UseSeafile -match "True" -and (Test-Path $Env:USERPROFILE\Documents\Seafile))
{
$SavePath = "$Env:USERPROFILE\Seafile\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
# Backup Chocolatey package names on local computer to packages.config file in TonidoSync directory if it exists
if ($UseTonidoSync -match "True" -and (Test-Path $Env:USERPROFILE\Documents\TonidoSync))
{
$SavePath = "$Env:USERPROFILE\Documents\TonidoSync\$SaveFolderName\$Env:ComputerName"
Write-PackageConfig
}
Write-Host "TO RE-INSTALL YOUR CHOCOLATEY PACKAGES:" -ForegroundColor magenta
Write-Host "1> Go to the location of your saved PACKAGES.CONFIG file and type CINST PACKAGES.CONFIG -Y" -ForegroundColor magenta
Write-Host "2> Get InstChoco and let it do it for you! - https://chocolatey.org/packages/InstChoco" -ForegroundColor magenta
Write-Host "Found choco-package-list-backup.ps1 useful? Consider buying me a beer via PayPal at https://www.paypal.me/bcurran3donations" -ForegroundColor white
Start-Sleep -s 10
$packageName = 'choco-package-list-backup'
$script = "choco-package-list-backup.ps1"
$shortcutName = 'Choco Package List Backup.lnk'
Remove-Item $env:ChocolateyInstall\bin\$script -Force -ErrorAction 'SilentlyContinue'
remove-item "$env:ProgramData\Microsoft\Windows\Start Menu\Programs\$shortcutName" -Force -ErrorAction 'SilentlyContinue'
Log in or click on link to see number of positives.
In cases where actual malware is found, the packages are subject to removal. Software sometimes has false positives. Moderators do not necessarily validate the safety of the underlying software, only that a package retrieves software from the official distribution point and/or validate embedded software against official distribution point (where distribution rights allow redistribution).
Chocolatey Pro provides runtime protection from possible malware.
Copyleft Bill Curran
This package has no dependencies.
Ground Rules:
- This discussion is only about (unofficial) Choco Package List Backup to Local and Cloud (Script) and the (unofficial) Choco Package List Backup to Local and Cloud (Script) package. If you have feedback for Chocolatey, please contact the Google Group.
- This discussion will carry over multiple versions. If you have a comment about a particular version, please note that in your comments.
- The maintainers of this Chocolatey Package will be notified about new comments that are posted to this Disqus thread, however, it is NOT a guarantee that you will get a response. If you do not hear back from the maintainers after posting a message below, please follow up by using the link on the left side of this page or follow this link to contact maintainers. If you still hear nothing back, please follow the package triage process.
- Tell us what you love about the package or (unofficial) Choco Package List Backup to Local and Cloud (Script), or tell us what needs improvement.
- Share your experiences with the package, or extra configuration or gotchas that you've found.
- If you use a url, the comment will be flagged for moderation until you've been whitelisted. Disqus moderated comments are approved on a weekly schedule if not sooner. It could take between 1-5 days for your comment to show up.