Skip to content

Instantly share code, notes, and snippets.

@guitarrapc
Last active December 15, 2015 12:58
Show Gist options
  • Save guitarrapc/d797c29529d23af34ab1 to your computer and use it in GitHub Desktop.
Save guitarrapc/d797c29529d23af34ab1 to your computer and use it in GitHub Desktop.
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