There is bug with workflows in PowerShell v3 that you might run into. I kept banging into it until I tracked it down. The problem occurs if you try to run a workflow from a PSDrive that you have added. For example, I have a PSDrive (S) which is mapped to C:\Scripts. When I try to run a workflow from this drive, I will get an error.
ManageEngine ADManager Plus - Download Free Trial
Exclusive offer on ADManager Plus for US and UK regions. Claim now!
PS S:\> get-foo
Cannot perform operation because operation "ResetRunspaceState" is not valid. Remove operation "ResetRunspaceState",
or investigate why it is not valid.
+ CategoryInfo : InvalidOperation: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidOperation
+ PSComputerName : [localhost]
The workaround is to simply change to your C: drive, or any PSDrive that PowerShell loads by default. Then the workflow will run.
PS C:\> get-foo
hello
This has been filed on Connect but I thought I'd share the workaround so you don't have to bang your head. And if you are curious about workflows, there will be a good chapter in the forthcoming PowerShell in Depth book.