powershell - 注册 SitecoreGallery 存储库时遇到困难
问题描述
想安装Sitecore9.1,首先尝试在PowerShell中注册repository。运行如下命令后报错。为什么会引发错误?需要帮助来解决这个问题。
Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
错误:
PackageManagement\Register-PackageSource : Module Repository 'SitecoreGallery' exists.
At C:\Program Files\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:4173 char:17
+ ... $null = PackageManagement\Register-PackageSource @PSBoundParamete ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceExists: (Microsoft.Power...erPackageSource:RegisterPackageSource) [Register-Pack
ageSource], Exception
+ FullyQualifiedErrorId : PackageSourceExists,Microsoft.PowerShell.PackageManagement.Cmdlets.RegisterPackageSource
解决方案
该错误表明此存储库已存在。首先,检查它是否正确注册:
PS C:\> Get-PSRepository
Name InstallationPolicy SourceLocation
---- ------------------ --------------
PSGallery Untrusted https://www.powershellgallery.com/api/v2/
SitecoreGallery Untrusted https://sitecore.myget.org/F/sc-powershell/api/v2
如果注册的数据不正确,您可以更改它:
Set-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
推荐阅读
- python - 如何在 Python Tkinter 中实时更改 csv 中的组合框值?
- java - 具有多线程的调度多任务处理,没有线程重叠
- python - 未找到带有参数 '('',)' 的 '' 的反向
- javascript - 有没有办法强制画布只用高度而不是宽度重新缩放?
- python - 使用 ElasticSearch DSL 在嵌套存储桶上进行聚合
- c - 在 libcurl 中,如何在重用连接时重置授权标头?
- php - 如何根据用户角色隐藏页面的一部分
- html - 当我编写外部 css 时,背景颜色不起作用,但如果我使用内联 css 或内部 css,bg 颜色工作正常
- node-ipc - 如何使用 node-ipc 观看服务器发送的没有消息类型的任何消息?
- list - Prolog,我想从列表中获取 2 个不同的值,并将所有其他值获取到另一个列表中