bcurran3 / ChocolateyPackages

My published Chocolatey packages
206 stars 94 forks source link

choco-cleaner: Get-Content : Cannot find path 'C:\config\chocolatey.config' because it does not exist. (choco `1.3.1`) #320

Closed brian6932 closed 1 year ago

brian6932 commented 1 year ago
Get-Content : Cannot find path 'C:\config\chocolatey.config' because it does not exist.
At C:\tools\bcurran3\choco-cleaner.ps1:72 char:25
+ ... onfigFile = Get-Content "$ENV:ChocolateyInstall\config\chocolatey.con ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (C:\config\chocolatey.config:String) [Get-Content], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand

Seems like 1.3.1 moved dirs

bcurran3 commented 1 year ago

Something's off here. Maybe you're running a super old version? Or a modified version? Choco-Cleaner shouldn't ever be looking there.

This is what it should be trying to read: $ChocoConfigFile = Get-Content "$ENV:ChocolateyInstall\config\chocolatey.config"

Simply uninstall and re-install please.

bcurran3 commented 1 year ago

p.s. New pre-release today you can test out (not related to this problem)

choco install choco-cleaner --pre

brian6932 commented 1 year ago

Yea this issue for me was solved, I just forgot to close this, my bad