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

About Alan

See http://www.akaplan.com/blog/about/
This entry was posted in PowerShell, Scripting and tagged , . Bookmark the permalink.

Leave a Reply