Export PowerShell script output to Text with Out-Notepad

Out-Notepad.ps1 lets you redirect the output of a PowerShell command or script into Notepad.

There are a couple of interesting things here. In Line 23, I use [System.IO.Path] to get a random file name. In line 34 I use [Microsoft.VisualBasic.Interaction] to shell out to Notepad and wait for it to close before deleting the file. You can, of course, save the file with a new name.

Script Text

Tags: ,

Leave a Reply

You must be logged in to post a comment.