I just installed the .NET Framework 4.0 and WMF 3.0 on a Server 2008 R2 SP1 machine that has SharePoint Foundation 2010 installed on it.
Now, when I go to Start - All Programs - Microsoft SharePoint 2010 Products - SharePoint 2010 Management Shell (run as administrator) I get the following error: The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
If I type: add-PSSnapin Microsoft.SharePoint.PowerShell then Get-SPFarm, I get the following:
Get-SPFarm : Microsoft SharePoint is not supported with version 4.0.30319.1 of the Microsoft .Net Runtime. At line:1 char:1 + Get-SPFarm + ~~~~~~~~~~ + CategoryInfo : InvalidData: (Microsoft.Share...SpCmdletGetFarm: SpCmdletGetFarm) [Get-SPFarm], PlatformNotSupportedException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SpCmdletGetFarm
It seems that after installing WMF 3.0, now Powershell is configured to run against .NET Framework 4.0. I am fine with that, but I need to be able to open at least one Powershell session against .NET 3.5 so that I can work with the SharePoint API.