powershell - 安装模块 PowerShellGet 时发出警告
问题描述
在安装 PowerShellGet 时,我执行以下操作:
Install-PackageProvider Nuget –force –verbose
然后我退出,尝试运行以下命令:
Install-Module –Name PowerShellGet –Force –Verbose
当我尝试安装其他模块(如 MSOnline、Azure 等)时也会发生此错误。我有最新版本的 Powershell 以及必要的模块。感觉是PowershellGet文件的原因。
有没有办法解决这个问题?
解决方案
You need to register the PowerShell repository before installing PowerShellGet. Try this
Register-PSRepository -Name “PSGallery” -SourceLocation “https://www.powershellgallery.com/api/v2/" -InstallationPolicy Trusted
推荐阅读
- google-sheets - 按工作日更改行颜色
- python - 简单的请求堆积在队列中
- swift - Marvel API 409 响应,“您必须提供用户密钥”
- nginx - Kubernetes 上的 NGINX 负载均衡
- ubuntu - vim 寄存器是否依赖于 wm 行为?
- php - 带有 PHP Laravel 5.6 的 Quickbooks 桌面应用程序
- ansible - ansible with_items stdout_lines 过滤器
- h2o - 使用 H2O 流量 XGboost 模型
- reactjs - React Apollo GraphQL 搜索/过滤器
- python - 在 python 中更新到现有配置文件部分的特定变量