Why not create the object?

Jul 23, 2009 at 7:05 PM

Why does the script only produce the text commands needed to make the new objects?  Why not go aehad with that last step?  Just seemed an odd choice to me, and trivial to change.

Jul 24, 2009 at 12:57 AM

Good question. That was two years ago. I was just getting my feet under me with PoSh.

I will have a look.

Jul 27, 2009 at 1:19 AM

Thanks for the suggestions. I checked in the changes.

IIRC my rationale for generating the new objects only was because to turn it into running objects I would only need to pipe it to ' | Invoke-Expression'.

In my private testing I was saving the text output of the ConvertFrom-JSON to a file or passing it to other scripts.

The changes are checked in and there is a [switch]$raw argument.

By default the objects are invoked. Pass in -raw and you get the the text.