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 Fanatic
http://scriptolog.blogspot.com
Hebrew weblog:
http://blogs.microsoft.co.il/blogs/scriptfanatic Quote:
> [xml]$a = "<hello>there</hello>"
> $a | tee-object -variable test
> gives
>
> Exception retrieving string: "Cannot find an overload for "XmlNode"
> and the argument count: "3"."
>
> .. anybody dare to suggest the cause of this bug. Maybe a side effect
> of the powershell adapter. and an assumption tee-object makes?
>
> -Karl
>