2

I have SharePoint 2010 on my machine, for development purposes, and I made the mistake of upgrading to .Net 4.0 and PowerShell 3.0.

The work around, running powershell with the -version 2.0 or -v 2 switch/arguement doesn't completely work.

So, this question is how do I add the Microsoft.Sharepoint.PowerShell snapin in Powershell, on a Machine that has the .Net 4.0 framework?

TRY 1:

PS> Add-PSSnapin Microsoft.Sharepoint.Powershell
The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
PS>  Get-SPSite('http://myServerName/')
Get-SPSite : Microsoft SharePoint is not supported with version 4.0.30319.18052 of the Microsoft .Net Runtime.

OK, So I TRY 2:

PS> powershell.exe -version 2.0
PS> Add-PSSnapin Microsoft.Sharepoint.Powershell
Add-PSSnapin : Incorrect Windows PowerShell version 3.0. Windows PowerShell version 2.0 is supported in the current console.
At line:1 char:13
+ Add-PSSnapin <<<<  Microsoft.Sharepoint.PowerShell
    + CategoryInfo          : InvalidArgument: (Microsoft.Sharepoint.PowerShell:String) [Add-PSSnapin], PSArgumentException
    + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand

I've also tried setting the target of the shortcut. And uninstalling the windows update that ends in q

So, thats my error that I cannot find any information on: Incorrect Windows PowerShell version 3.0. Windows PowerShell version 2.0 is supported in the current console.

Any thoughts?

2 Answers 2

1

After a recent SharePoint 2010 update i am able to add the powershell snapin, while running powershell in version 2.0

Sign up to request clarification or add additional context in comments.

Comments

0

It appears to work for me if I call

    powershell.exe -version 2.0 

from the Command Prompt instead of calling it from Powershell.

1 Comment

Nope, John D., I tried running powershell from the Command Prompt but I'm getting the same error as, from above, 'TRY 2'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.