Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为什么PowerShell 5在重命名后仍在寻找旧的PowerShell库路径?_Powershell - Fatal编程技术网

为什么PowerShell 5在重命名后仍在寻找旧的PowerShell库路径?

为什么PowerShell 5在重命名后仍在寻找旧的PowerShell库路径?,powershell,Powershell,我有一个本地PowerShell库,已重命名为JNPGallery。 我注销了旧路径\\\Ryzen\G$\JnPowerShellGallery,然后注册了新路径\\\Ryzen\G$\JnPSGallery,但在使用更新模块命令时,PowerShell 5仍在尝试查找旧路径。我甚至尝试注销所有存储库,然后输入更新模块,看看会发生什么 我收到错误“PackageManagement\Install Package:找不到存储库\\\Ryzen\G$\JnPowerShellGallery”。使

我有一个本地PowerShell库,已重命名为JNPGallery。
我注销了旧路径
\\\Ryzen\G$\JnPowerShellGallery
,然后注册了新路径
\\\Ryzen\G$\JnPSGallery
,但在使用更新模块命令时,PowerShell 5仍在尝试查找旧路径。我甚至尝试注销所有存储库,然后输入更新模块,看看会发生什么

我收到错误“PackageManagement\Install Package:找不到存储库
\\\Ryzen\G$\JnPowerShellGallery
”。使用
Get PSRepository
查看所有可用的存储库。即使所有存储库都未注册,它仍在查找旧的PowerShell库路径

注册新JNPGallery路径后更新模块。

删除所有已注册的存储库后更新模块。


如何阻止PowerShell 5尝试使用旧路径
\\\Ryzen\G$\jPowerShellGallery

感谢您的帮助Joel&adrian.anderson。我解决了我的问题

powershell帮助频道上的Joel建议我安装的一些模块可能仍然引用我的旧PSGallery路径。他是对的

今天早上醒来时,我打开了PowerShell 5,输入Get InstalledModule,就在我面前的两个模块仍然在引用我以前的PSGallery路径。我卸载了这些模块,错误消失了

我原本以为问题出在PowerShellGet模块上。我现在觉得自己很傻

获取安装模块,显示引用旧库的两个模块。

多亏了乔尔,我才免于重新安装Windows