How to get SharePoint PowerShell to use .NET 2

I'm having problems with PowerShell. First, the PS configuration installed by SharePoint 2010 continues to call this message:

Local farm is not available. Cmdlets with FeatureDependencyId have not been registered.

I searched for this and gave everyone and their cousin Sharepoint_Shell_Access to the configuration database, with no luck. So, I wanted to try some PS commands. In this case, however, I get another error:

Microsoft SharePoint is not supported by version 4.0.30319.17929 in the Microsoft.Net Runtime environment.

I get that SP cannot use .NET 4.0 or 4.5, but I cannot find any suggestions on how to get PS to use the "correct" version of .NET. I found some links to something called PowerGUI and changed psgui.exe.config, but I don't have it.

Does anyone have any suggestions to solve the problem with the version of .NET?

+8
powershell sharepoint config
source share
2 answers

When you install powershell v3, version 2 is still available in side-by-side mode. To use snapin SharePoint, you must run v2 as follows:

powershell -v 2 

Then you can download snapin for SharePoint.

For reference, here is the result of calling PowerShell v2 from Windows 8 cmd.exe:

 C:\Windows\System32\WindowsPowerShell\v1.0>powershell.exe -version 2 Windows PowerShell Copyright (C) 2009 Microsoft Corporation. All rights reserved. PS C:\Windows\System32\WindowsPowerShell\v1.0> $psversiontable Name Value ---- ----- CLRVersion 2.0.50727.6387 BuildVersion 6.1.7600.16385 PSVersion 2.0 WSManStackVersion 2.0 PSCompatibleVersions {1.0, 2.0} SerializationVersion 1.1.0.1 PSRemotingProtocolVersion 2.1 PS C:\Windows\System32\WindowsPowerShell\v1.0> [Environment]::Version Major Minor Build Revision ----- ----- ----- -------- 2 0 50727 6387 
+13
source share

You can add the -version 2 command line -version 2 to the Start Menu element by right-clicking it, selecting Properties and editing the line in the Target field.

This fix also clears the error message.

Local farm is not available. Cmdlets with FeatureDependencyId have not been registered.

I received this message when starting the SharePoint 2010 Management Shell.

+4
source share

All Articles