Runtime Error

Jul 30, 2013 at 4:25 PM
Edited Jul 30, 2013 at 4:26 PM
Hello,
I'm trying to compile a ps1 file that contains the following PS code:
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
Get-MailboxFolderStatistics MyUsername | ft Name
but have the following error:

An unexpected error has occurred and a Watson dump is being generated: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and ca
nnot be loaded in the 4.0 runtime without additional configuration information.
An unexpected error has occurred and a Watson dump is being generated: Mixed mode assembly is built against version 'v2.0.50727' of the runtime and ca
nnot be loaded in the 4.0 runtime without additional configuration information.

what should I do?