PowerShell – Out-Notepad function

There are many out-notepad functions out there but for some reason I found them either too long or too complicated so here is mine, short and sweet:

Function Out-Notepad {
$fso=new-object -com scripting.filesystemobject
$tempfile=Join-Path $env:temp $filename
$strText | Out-File $tempfile
notepad $tempfile
#tidy up
sleep 3
if (Test-Path $tempfile) {del $tempfile}

Leave a Reply

Your email address will not be published. Required fields are marked *

one + fifteen =

This site uses Akismet to reduce spam. Learn how your comment data is processed.