Why not create the object?

Developer
Jul 23, 2009 at 6: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.

Coordinator
Jul 23, 2009 at 11:57 PM

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

I will have a look.

Coordinator
Jul 27, 2009 at 12: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.