首页 > 解决方案 > 注册 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

标签: powershellsitecoresitecore-mvc

解决方案


该错误表明此存储库已存在。首先,检查它是否正确注册:

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

推荐阅读