我之前安装了 pscx,但由于某种原因它已经停止工作,并且不会重新安装。
以管理员身份运行,如果我尝试使用安装
install-module pscx -allowClobber -scope CurrentUser
它询问是否信任 repo、下载并开始安装,但随后抛出此错误
Install-Package: C:\program files\powershell\7\Modules\PowerShellGet\PSModule.psm1:9711
Line |
9711 | … talledPackages = PackageManagement\Install-Package @PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Administrator rights are required to install or update. Log on to the computer with an account that has Administrator rights, and then try
| again, or install by adding "-Scope CurrentUser" to your command. You can also try running the Windows PowerShell session with elevated
| rights (Run as Administrator).
它不应该需要管理员权限来安装-scope CurrentUser
开关集,而且无论如何它都是一个管理员外壳,所以这里发生了其他事情。
如果我在 Powershell 6 中尝试该命令,它可以正常安装,但这些模块在 pwsh 中不起作用。