When you launch a SharePoint 2010 Management Shell you receive one or both of the following errors:
“microsoft sharepoint is not supported with version 4.0.30319 of the microsoft .net runtime”
“the local farm is not accessible cmdlets with feature dependency are not registered”
At the command prompt run the following commands:
PS C:\ > $ver=$host | select version
PS C:\ > $ver.Version
Major Minor Build Revision
----- ----- ----- --------
3 0 -1 -1
If the version indicated is not “2” this causes the shell console to execute in the context of the unsupported runtime as indicated in the error above.
First try to import system modules and as indicated in the following screen capture:
- 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 ' "
Many Thanks and Kudos to Mr. Darrin Dyson of Venable LLP. for his collaborative efforts on this post.