There is an existing issue for this opened at connect.microsoft.com/PowerShell
https://connect.microsoft.com/PowerShell/feedback/details/137702
but is has been Closed (Won't Fix) with no comment justifying that action by
Microsoft.
Should we reinstate a request for a product change to add the -Append option to
the Tee-Object cmdlet?
- Larry
You could create a Proxy Function for Tee-Object and add this
functionality.
Write-output "Text" | %{out-host; out-file -filepath "$filename" -append}
"Larry__Weiss" wrote:
> .
>
dir | tee-object -Variable tee
out-file tee.out -InputObject $tee -Append
- Larry
${C:tee.out}
to Tee-Object.
dir | tee-object -Variable {C:tee.out}
won't work.
It just creates a variable named C:tee.out instead of
a file named C:tee.out
- Larry