PowerShell 3.0, .NET 4.0 & SharePoint 2010

Good Afternoon

Probably some of you ,due to any automatic update in your SharePoint 2010 servers, may notice that opening the SP 2010 Management Shell you are prompted with the following messages:

           Error: "The local farm is not accessible. Cmdlets withFeatureDependencyId are not registered."

Moreover, it turns out executing cmdlets you are having next error:

           "Microsoft SharePoint is not supported with versión 4.0.30319.17929 of the Microsoft .Net Runtime."

As all we may know SharePoint 2010 is bulit on .NET 3.5 that relies on .NET 2.0. So, as PowerShell 3.0 uses .NET 4.0 , the assemblies compiled on .NET 3.5 of our SharePoint 2010 are not working.

Then, in order to solve this issue temporally you should modify the shortcut of the start menú of SP 2010 Management Shell and forcé it to use PowerShell 2.0 instead of PowerShell 3.0.

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe-NoExit - versión 2.0 "& 'C:\Program archivos de programa\Archivos comunes\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\sharepoint.ps1'"

For more information you can check the next KB



Kind Regards.

Héctor Calvarro Martín. SharePoint Dev/Core. Microsoft Support Escalation Engineer for EMEA.