Why PowerShell 5 still looking for old PowerShell Gallery path after it was renamed?

Viewed 40

I have a local PowerShell Gallery that I renamed to JnPSGallery.
I unregistered the old path \\\Ryzen\G$\JnPowerShellGallery and then registered the new path \\\Ryzen\G$\JnPSGallery, but PowerShell 5 is still trying to look for the old path when I use the Update-Module command. I even tried unregistering all repositories and then typed in Update-Module to see what would happen.

I get the error 'PackageManagement\Install-Package : Unable to find repository \\\Ryzen\G$\JnPowerShellGallery. Use Get-PSRepository to see all available repositories.' Even with all repositories unregistered, it is still looking for the old PowerShell Gallery path.

Update-Module after registering new JnPSGallery path.
https://i.imgur.com/SOgk3zn.png

Update-Module after removing all registered repositories.
https://i.imgur.com/ZFTi0ut.png

How do I stop PowerShell 5 from trying to use the old path \\\Ryzen\G$\JnPowerShellGallery?

1 Answers

Thanks for your help Joel & adrian.anderson. I fixed my problem!

Joel on http://slack.poshcode.org/ powershell-help channel suggested that some of my installed modules might still be referencing my old PSGallery path. He was right!

When I woke up this morning, I opened PowerShell 5, typed in Get-InstalledModule and there right in front of me were the two modules that were still referencing my old PSGallery path. I uninstalled those modules and the errors went away.

I had originally thought the problem was with the PowerShellGet module. I feel silly now.

Get-InstalledModule showing two modules referencing old gallery.
https://i.imgur.com/TWFtWcP.png

Thanks to Joel it saved me from re-installing Windows.

Related