Sdílet prostřednictvím


Running SharePoint 2010 Management Shell on Windows 8

So, you installed windows 8 pro and got SharePoint 2010 running as your dev environment. The first thing you will notice is that you can no longer execute the SharePoint PowerShell commands. When you open the SharePoint 2010 Management Shell, you get the following error:

"the local farm is not accessible. Cmdlets with FeatureDependencyId are not registered".

 

Well, Windows 8 uses Windows Management Framework 3.0 which includes PowerShell 3.0 which in turn is based on .NET Framework 4.0. Since the SharePoint 2010 Management Shell uses .NET Framework 3.5, we cannot use PowerShell 3.0. Therefore, we have to force the shortcut to use PowerShell 2.0, by specifying the -Version command.

 

Whew!

To make this work, change the target of the shortcut "SharePoint 2010 Management Shell" as follows:

C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -version 2 -NoExit " & ' C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1 ' "

Comments

  • Anonymous
    December 22, 2012
    Nice. Almost pulled my hair out with this thing... Saved me from going bald.

  • Anonymous
    December 31, 2012
    Sometimes even above solution won't work. In that scenario you have to run below commands from power shell command prompt. powershell -v 2 Add-PsSnapin Microsoft.SharePoint.PowerShell