Skip to content

Instantly share code, notes, and snippets.

@emptyother
Last active July 22, 2017 12:00
Show Gist options
  • Save emptyother/258bc78ad85c0239a93a318f3323af23 to your computer and use it in GitHub Desktop.
Save emptyother/258bc78ad85c0239a93a318f3323af23 to your computer and use it in GitHub Desktop.
Pipe powershell data to notepad
Param(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
$InputObject
)
begin {
$tempfile = [System.IO.Path]::GetTempFileName();
$collection = @();
}
process {
foreach($in in $InputObject) {
$collection += $in
}
}
end {
$collection | Out-String | Out-File $tempfile
notepad $tempfile
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment