PowerTip: Display and Write Output


Summary: Learn to display output and write it to a text file.

Hey, Scripting Guy! Question I need to display process output at the Windows PowerShell prompt and write that same output to a text file. How can I do this?

Hey, Scripting Guy! Answer Get-process | Tee-Object -FilePath c:\fso\proc.txt

Comments (3)

  1. Walid Toumi says:

    Hi

    another variant:

    PS II> &{($a=gps);$a>g.txt}

  2. Ed Wilson says:

    @Walid Toumi very good. I like it. thanks for sharing!

Skip to main content