powershell - 在 powershell core 7.1.3 中安装 pscx 失败
问题描述
我之前安装了 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 中不起作用。
解决方案
推荐阅读
- hyperledger-fabric - Hyperledger Fabric CA:http:来自 127.0.0.1:53356 的 TLS 握手错误:tls:收到长度为 21536 的超大记录
- vue.js - Vue flickr 应用程序中的搜索栏未提供预期结果
- javascript - 将任何 URL 转换为相对 URL
- meteor - 当我尝试运行 npm install 时 Meteor 抛出 gyp 错误
- c# - 使用 IdentityServer4 加载项目时 DefaultUserSession 中的 NullReferenceException
- powershell - 获取一个AD用户的经理并将其输入到表格的列中
- css - 使用 ::before 作为创造空间的方式的目的是什么?
- swift - Swift 不会在具有关联类型的协议扩展函数中调用重写的类 var
- c# - 构建项目 .Net 本机工具链启用导致内部编译器错误:已添加具有相同密钥的项目
- php - 数据库播种错误:未找到列:1054 未知列“字段列表”中的“client_id”