Solution:
This error will be generated if the snap-in has not been registered. To register the snap-in use the following command:

Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010