Powershell 术语';挥霍无度';未识别为cmdlet的名称

Powershell 术语';挥霍无度';未识别为cmdlet的名称,powershell,sharepoint-2010,Powershell,Sharepoint 2010,我是Sharepoint的新手。。。我正在尝试部署一个简单的web部件 当我部署它并将其放在页面上时,我会得到一个带有相关id的错误 现在,我正在尝试获取有关错误的详细信息,并使用Powershell键入 get-splogevent | ?{$_Correlation -eq "bcce1b39-f277-4b2b-b8f8-4c113a30f193" } 但这给了我一个错误 The term 'get-splogevent' is not recognized as the name o

我是Sharepoint的新手。。。我正在尝试部署一个简单的web部件

当我部署它并将其放在页面上时,我会得到一个带有相关id的错误

现在,我正在尝试获取有关错误的详细信息,并使用Powershell键入

 get-splogevent | ?{$_Correlation -eq "bcce1b39-f277-4b2b-b8f8-4c113a30f193" }
但这给了我一个错误

The term 'get-splogevent' 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 line:1 char:15
+ get-splogevent <<<<  | ?{$_Correlation -eq "bcce1b39-f277-4b2b-b8f8-4c113a30f193" }
    + CategoryInfo          : ObjectNotFound: (get-splogevent:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
术语“get splogevent”不能识别为cmdlet、函数、脚本文件或可操作程序的名称。请检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。
第1行字符:15

+获取splogevent您很可能正在进行普通的Powershell会话。未加载Sharepoint管理管理单元,因此未找到cmdlet。看一看,它描述了如何将管理单元自动加载到所有Powershell会话

管理单元是这样手动加载的

Add-PSSnapin "Microsoft.SharePoint.PowerShell"

我正在启动solo powershell而不是sharepoint。任务bat中有“Sharepoint 2010 Management Shell”,使用该命令行得通。

是否已将Sharepoint的PSSnapin添加到Powershell会话中?我刚刚尝试了它,收到消息:Add-PSSnapin:无法在Microsoft.Sharepoint.Power Shell中添加Windows Powershell管理单元,因为它已被添加。请验证管理单元的名称,然后重试