gpt4 book ai didi

powershell - 术语 'select-object' 未被识别为 cmdlet 的名称

转载 作者:行者123 更新时间:2023-12-02 23:46:55 31 4
gpt4 key购买 nike

在 Windows Server 2012 上启动 SharePoint Management Shell for SP2013 时出现错误。

select : The term 'Select-Object' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At C:\Program Files\Common Files\Microsoft Shared\Web Server
Extensions\15\CONFIG\POWERSHELL\Registration\SharePoint.ps1:1 char:16

  • $ver = $host | select version
  • ~~~~~~
    • CategoryInfo : ObjectNotFound: (Select-Object:String) [], Comma ndNotFoundException
    • FullyQualifiedErrorId : CommandNotFoundException


我需要导入任何模块吗?如果有,从哪里来?

最佳答案

我解决了我的问题。

我的是一个 SharePoint 2013 盒子。我发现 $env:psmodulepath 为 C:\Users\user_name\Documents\WindowsPowerShell\Modules;;C:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules;C:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules如您所见,AppFabric 模块路径已重复。我猜 AppFabric 在安装时弄乱了 psmodulepath。
所以,我修改了PSModulePath注册表下的变量(位于 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment )以包含 ;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules进行此更改后,我可以执行 select 和其他基本 cmdlet。

谢谢,
普拉迪普努鲁

关于powershell - 术语 'select-object' 未被识别为 cmdlet 的名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18446744/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com