Skip to content

Instantly share code, notes, and snippets.

Created September 13, 2013 01:59
What would you like to do?
Start a process and manipulate stdin in PowerShell
try {
$MyProcess = New-Object System.Diagnostics.Process
$MyProcess.StartInfo.FileName = "c:\MyProcess.exe"
$MyProcess.StartInfo.Arguments = "arguments for process"
$MyProcess.StartInfo.UseShellExecute = $false
$MyProcess.StartInfo.RedirectStandardInput = $true
$StdIn = $MyProcess.StandardInput
$StdIn.WriteLine("some data")
} finally {
if($StdIn) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment