SharePoint 2010 vs PowerShell 3.0 CLR

Microsoft SharePoint 2010 is not supported with version 4.0+ of the Microsoft .NET Framework. This issue can come into play if you happen to install the Windows Management Framework 3.0+, .NET Framework 4.0+, or PowerShell v3.0. All of these items run on a CLR (Common Language Runtime) of 4.0+, the default that comes with these applications. When loading the SharePoint 2010 Management Shell, you may see one of the following:

The local farm is not accessible. Cmdlets with FeatureDependencyID are not registered

or

Microsoft SharePoint is not supported with version 4.0.x

To address this, there are a couple of workarounds:

Force the SharePoint Management Shell to use PowerShell Version 2


Forcing the shell to run on PSv2 is a quick workaround that requires no downtime, restarts, or interruptions in services.

    1.  Right click the icon for the SharePoint Management Shell, click Properties
    2. Click the shortcut tab in the properties window
    3. Input the following into the target value:

This will force the Shell to open in PowerShell v2.0, running the CLR 2.0.X. To verify this, open the SharePoint Management Shell, and type $psversiontable. This will show you the version of CLR and PowerShell that the current session is utilizing.

Force PowerShell to globally use a different CLR

  1. Create or edit a file at $pshome\powershell.exe.config
  2. Insert or edit the contents to include the line for the CLR 2.0.X support, ensuring that this is before the 4.0 callout (the order of the supported run times shows how the system will favor each).
  3. Save the file and reopen any previous PowerShell sessions
  4. Test this by opening PowerShell and running the $psversiontable command