Last active
July 22, 2017 12:00
-
-
Save emptyother/258bc78ad85c0239a93a318f3323af23 to your computer and use it in GitHub Desktop.
Pipe powershell data to notepad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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