Last active
December 15, 2015 12:58
-
-
Save guitarrapc/d797c29529d23af34ab1 to your computer and use it in GitHub Desktop.
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
function ConvertFrom-JsonToProcess | |
{ | |
[OutputType([System.Diagnostics.Process[]])] | |
[CmdletBinding()] | |
param | |
( | |
[Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
[string]$Path | |
) | |
process | |
{ | |
cat $Path | ConvertFrom-Json | |
} | |
} |
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
ps | select -First 2 | ConvertTo-Json | Out-File .\hoge.json | |
ConvertFrom-JsonToProcess -Path .\hoge.json | %{$_} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment