爲了開發目的,我在我的計算機上安裝了SharePoint 2010,並且我犯了升級到.Net 4.0和PowerShell 3.0的錯誤。Microsoft.SharePoint.PowerShell管理單元:Windows PowerShell 3.0版不正確。當前控制檯支持Window PowerShell 2.0版
周圍的工作,與-version 2.0或-v 2開關/運行arguement的powershell完全不起作用。
因此,這個問題是如何在PowerShell中添加Microsoft.Sharepoint.PowerShell管理單元,在具有.Net 4.0框架的計算機上?
TRY 1:
PS> Add-PSSnapin Microsoft.Sharepoint.Powershell
The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
PS> Get-SPSite('http://myServerName/')
Get-SPSite : Microsoft SharePoint is not supported with version 4.0.30319.18052 of the Microsoft .Net Runtime.
OK,所以我儘量2:
PS> powershell.exe -version 2.0
PS> Add-PSSnapin Microsoft.Sharepoint.Powershell
Add-PSSnapin : Incorrect Windows PowerShell version 3.0. Windows PowerShell version 2.0 is supported in the current console.
At line:1 char:13
+ Add-PSSnapin <<<< Microsoft.Sharepoint.PowerShell
+ CategoryInfo : InvalidArgument: (Microsoft.Sharepoint.PowerShell:String) [Add-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
我也嘗試設置快捷方式的目標。 和卸載Windows更新是在Q
因此結束,這就是我的錯誤,我無法找到任何信息: 不正確的Windows PowerShell 3.0版本。當前控制檯支持Windows PowerShell版本2.0。
有什麼想法?
不,約翰,我試圖從命令提示符下運行PowerShell的,但我得到了同樣的錯誤如上所述,「TRY 2」。 – sylatupa