How to Get SharePoint PowerShell to use .NET 2
When you install powershell v3, version 2 is still available in side by side mode. In order to use the SharePoint snapin, you must launch v2 like this:
powershell -v 2
Then you can load the snapin for SharePoint.
For reference, here is the output from invoking PowerShell v2 from Windows 8 cmd.exe:
C:\Windows\System32\WindowsPowerShell\v1.0>powershell.exe -version 2Windows PowerShellCopyright (C) 2009 Microsoft Corporation. All rights reserved.PS C:\Windows\System32\WindowsPowerShell\v1.0> $psversiontableName Value---- -----CLRVersion 2.0.50727.6387BuildVersion 6.1.7600.16385PSVersion 2.0WSManStackVersion 2.0PSCompatibleVersions {1.0, 2.0}SerializationVersion 1.1.0.1PSRemotingProtocolVersion 2.1PS C:\Windows\System32\WindowsPowerShell\v1.0> [Environment]::VersionMajor Minor Build Revision----- ----- ----- --------2 0 50727 6387
One can add the command line switch -version 2
to the Start Menu
item by right clicking it, selecting Properties
, and editing the string in the Target
field.
This fix also clears up the erroneous message
The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
I was getting this message when launching SharePoint 2010 Management Shell.