首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >寄存器-PsRepository:在此对象上找不到属性'Name‘

寄存器-PsRepository:在此对象上找不到属性'Name‘
EN

Stack Overflow用户
提问于 2018-05-07 09:54:07
回答 1查看 2.8K关注 0票数 4

当尝试运行时,我会遇到以下错误

我试过:

  • 重新安装WMF 5、PowerShellGet和PackageManagement模块
  • 更新所述模块
  • 调试PowerShellGet模块我可以看到,PsBoundParameters确实将名称值传递给Register命令。
  • 当我手动运行时,寄存器-PackageSource确实可以正常工作。

有什么想法吗?

代码语言:javascript
复制
PS C:\> Register-PSRepository -Name MyRepo -SourceLocation  https://MyRepo.com/api/Myrepo   -Credential $c
PackageManagement\Register-PackageSource : The property 'Name' cannot be 
found on this object. Verify that the property exists.
At C:\Program  Files\WindowsPowerShell\Modules\PowerShellGet\1.6.0\PSModule.psm1:4631 char:17
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-05-08 15:03:13

请检查PSRepository配置xml文件:

%localappdata%\Microsoft\windows\PowerShell\PowerShellGet\PSRepositories.xml

有可能文件已损坏,这可能会导致您正在获取的错误。

票数 7
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50211425

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档