Closed gbloice closed 1 year ago
It's not doing that by design. My guess is it's aborting in the middle. v1.0.0 or v1.1.0? choco 1.x or 2.x?
560e484
added Set-Location cause this phenomenon
Set-Location -Path "$env:ChocolateyInstall\.chocolatey"
Using Windows Terminal, Powershell 7.3.4
>cd c:\temp choco list choco-cleaner
Chocolatey v2.0.0
choco-cleaner 1.1.0
I've seen this behaviour since choco-cleaner 1.0.0.
FWIW I usually run choco-cleaner straight after running choco upgrade. If I run it again, i.e. on a "cleaned" installation then the working directory isn't changed.
Workaround: use choco-cleaner.bat instead of choco-cleaner.ps1
v1.1.1 eliminates this behavior. CC now deletes the dirs using the full path instead of changing to the .chocolatey dir.
choco install choco-cleaner --version=1.1.1
Running choco-cleaner from a PowerShell prompt does the expected cleanup but leaves the working directory as
C:\ProgramData\chocolately\.chocolatey
.Ideally it should leave the working directory as it was before choco-cleaner was run.