Skip to content

Instantly share code, notes, and snippets.

@jpluimers
Created January 17, 2020 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpluimers/1c0a4716aa05d4af0806479e44a243ce to your computer and use it in GitHub Desktop.
Save jpluimers/1c0a4716aa05d4af0806479e44a243ce to your computer and use it in GitHub Desktop.
choco-cleaner upgrade and test for environment variable
C:\bin\bin>choco upgrade choco-cleaner
Chocolatey v0.10.15
Upgrading the following packages:
choco-cleaner
By upgrading you accept licenses for the packages.
You have choco-cleaner v0.0.5.2 installed. Version 0.0.7.1 is available based on your source(s).
Progress: Downloading choco-cleaner 0.0.7.1... 100%
choco-cleaner v0.0.7.1 [Approved]
choco-cleaner package files upgrade completed. Performing other installation steps.
The package choco-cleaner wants to run 'chocolateyinstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): y
SUCCESS: The scheduled task "choco-cleaner" was successfully deleted.
PATH environment variable does not have C:\tools\BCURRAN3 in it. Adding...
Refreshing environment variables from the registry for powershell.exe. Please wait...
Finished
Adding C:\ProgramData\chocolatey\bin\choco-cleaner.bat and pointing it to powershell command C:\tools\BCURRAN3\choco-cleaner.ps1
SUCCESS: The scheduled task "choco-cleaner" has successfully been created.
Folder: \
TaskName Next Run Time Status
======================================== ====================== ===============
choco-cleaner 1/19/2020 11:00:00 PM Ready
Now configured to run choco-cleaner at 11:00 PM every SUNDAY.
You can manually run choco-cleaner from the Command Prompt and Powershell.
Environment Vars (like PATH) have changed. Close/reopen your shell to
see the changes (or in powershell/cmd.exe just type `refreshenv`).
The upgrade of choco-cleaner was successful.
Software install location not explicitly set, could be in package or
default install location if installer.
Chocolatey upgraded 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
C:\bin\bin>set | grep -i choco
ChocolateyInstall=C:\ProgramData\chocolatey
ChocolateyLastPathUpdate=132046303523761893
Path=C:\Program Files\ImageMagick-7.0.9-Q16;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;
C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\bin\bin;C:\Program Files\Mercurial\;;C:\Users\jeroenp\AppData\Local\Programs\Fiddler
Path_HKLM=C:\Program Files\ImageMagick-7.0.9-Q16;;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin;C:\Program Files\Git
\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin
C:\bin\bin>%ChocolateyInstall%\bin\choco-cleaner.bat
Choco-Cleaner.ps1 v0.0.7.1 (01/16/2020) - deletes unnecessary residual Chocolatey files to free up disk space
Copyleft 2017-2020 Bill Curran (bcurran3@yahoo.com) - free for personal and commercial use
WARNING: $env:ChocolateyToolsLocation not defined.
ScriptHalted
At C:\tools\BCURRAN3\choco-cleaner.ps1:11 char:98
+ ... not defined.' ;throw}
+ ~~~~~
+ CategoryInfo : OperationStopped: (:) [], RuntimeException
+ FullyQualifiedErrorId : ScriptHalted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment