I\'ve written a powershell module in c# that has a bunch of cmdlets like
Add-VM
The cmdlets reach out to an API and pull data back.
but for the sake
I know this is a little old now, but I was having a similar issue and a co-worker showed me that escaping $argstr prevents the object from getting converted to a string.
Invoke-Expression "Add-VM `$argstr"