Thread: tee-object bug
View Single Post
Old 12-19-2007   #5 (permalink)
Oisin Grehan
Guest


 
 

Re: tee-object bug

On Dec 19, 2:57 am, Shay Levi <n...@xxxxxx> wrote:
Quote:

> Shouldn't you add a reference to $test or I'm missing something?
>
> PS > $test=""
> PS > [xml]$a = "<hello>there</hello>"
> PS > $a | tee-object -variable [ref]test
>
> hello
> -----
> there
>
> The help for tee-object:
>
> -variable <string>
> Assigns a reference to the input objects to the specified variable.
>
> -----
> Shay Levi
> $cript Fanatichttp://scriptolog.blogspot.com
> Hebrew weblog:http://blogs.microsoft.co.il/blogs/scriptfanatic
>
>
>
Quote:

> > [xml]$a = "<hello>there</hello>"
> > $a | tee-object -variable test
> > gives
>
Quote:

> > Exception retrieving string: "Cannot find an overload for "XmlNode"
> > and the argument count: "3"."
>
Quote:

> > .. anybody dare to suggest the cause of this bug. Maybe a side effect
> > of the powershell adapter. and an assumption tee-object makes?
>
Quote:

> > -Karl- Hide quoted text -
>
> - Show quoted text -
Hey Shay,

just an FYI: using [ref] in this way doesn't work - that particular
parameter takes a string. I think the reason it appears to work is
because tee-object is silently ignoring the invalid variable name.
replacing [ref] with any other text in square brackets has the same
effect.

- Oisin / x0n
My System SpecsSystem Spec