I have a powershell script that I am trying to execute from WCF REST service.I am using the System.Management.Automation and System.Management.Automation.
I just googled that error and it seemed to be related to legacyCasPolicy being set to true as discussed here and here. It turns setting it to false resolved your issue as well. Detailed information about this configuration element can be found here.