2

爲了開發目的,我在我的計算機上安裝了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。

有什麼想法?

回答

0

最近的SharePoint 2010的更新,我能夠加入PowerShell的管理單元,而在版本上運行的PowerShell 2.0後

0

這似乎爲我工作,如果我叫

powershell.exe -version 2.0 

從命令提示符,而不是從Powershell的調用它。

+0

不,約翰,我試圖從命令提示符下運行PowerShell的,但我得到了同樣的錯誤如上所述,「TRY 2」。 – sylatupa

相關問題