When attempting to perform a farm backup of a SharePoint 2010 farm using Recovery Manager the following error occurs:
Command Status: 2, Message: Backup-SPFarm : Microsoft SharePoint is not supported with version
4.0.30319.1008 of the Microsoft .Net Runtime.
At line:1 char:47
+ Add-PsSnapin Microsoft.SharePoint.PowerShell; Backup-SPFarm -Directory
SharePoint 2010 does not support the .NET framework 4.0 so this is a limitation with SharePoint itself however there is a valid workaround.
Locate the following file, create a backup of this file and then open the original file with Wordpad or another XML-editing tool:
%RMSP_installdir%\XML\DisasterRecoveryRules.xml.
Locate line 632 and insert -Version 2 at the beginning of this line. The full line should now be:
-Version 2 "Add-PsSnapin Microsoft.SharePoint.PowerShell; Backup-SPFarm -Directory '%(Param1)s' -BackupMethod %(Param2)s -Verbose"
Save this file. If you have a Recovery Manager agent deployed to a WFE server you must repeat this process on that WFE server.
Re-run your farm-backup which should no longer display the original error.