tags:

views:

42

answers:

1

Working on a simple helper function in PowerShell that takes a couple of parameters and creates a custom Enumerable object and outputs that object to the pipeline. The problem I am having is that PowerShell is always outputting a System.Array that contains the objects that are enumerated by my custom Enumerable object. How can I keep PowerShell from unpacking the Enumerable object?

The code: http://gist.github.com/387768

+4  A: 

Try to change the line 46 from

$row

to

, $row

EDIT: as Johannes correctly pointed out, the unary operator comma creates an array with one member.

Roman Kuzmin
Explanation: This wraps whatever you want to return in an array (with just one element). This array will be unwrapped but its contents are not.
Joey