Issue with PowerShell 2.0 (SharePoint 2010 Management Shell) after upgrading to SnapManger 8 and SnapDrive 7
SharePoint 2010 Management Shell Errors
- The local farm is not accessible. Cmdlets with FeatureDependencyId are not registered.
- A PlatformNotSupportedException occurred while trying to acquire the local farm: System.PlatformNotSupportedException: Microsoft
SharePoint is not supported with version 4.0.30319.586 of the Microsoft .Net Runtime.
at Microsoft.SharePoint.Administration.SPConfigurationDatabase.get_Farm() at Microsoft.SharePoint.Administration.SPFarm.FindLocal(SPFarm& farm, Boolean& isJoined)
We may have all seen the above errors before and in the end, the fix that you’ll find all over the internet will work but you have to get there first.. So, here goes:
This issue was caused by the upgrade of SnapManager for SharePoint (AvePoint/Netapp). We upgraded to version 8 which required us to also upgrade SnapDrive to version 7 (we were at 6.5 which is not compatible with SnapManager 8). This change forces PowerShell 2.0 to use the .Net Framework 4.0. Obviously, SharePoint 2010 Management Shell doesn’t like this (works only with .Net 2.0/3.5), so the solution was to install (upgrade) PowerShell 3.0 and ‘then’ change the Target properties of SharePoint 2010 Management Shell to:
C:\Windows\System32\WindowsPowerShell\v1.0\PowerShell.exe -Version 2.0 -NoExit ” & ‘ C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\CONFIG\POWERSHELL\Registration\\SharePoint.ps1 ‘ “
The guys/gals over at Netapp are now aware of this issue and should be providing a fix in the near the future. So there it is.. Hope this helps!!!