Instantly share code, notes, and snippets.

Embed
What would you like to do?
function ConvertFrom-JsonToProcess
{
[OutputType([System.Diagnostics.Process[]])]
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true, ValueFromPipeline = $true)]
[string]$Path
)
process
{
cat $Path | ConvertFrom-Json
}
}
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