PowerTip: Display and Write Output

PowerTip: Display and Write Output

  • Comments 3
  • Likes

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

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment
  • <p>Hi</p> <p>another variant:</p> <p>PS II&gt; &amp;{($a=gps);$a&gt;g.txt}</p>

  • <p>@Walid Toumi very good. I like it. thanks for sharing!</p>

  • <p>very funny</p>