15 lines
474 B
PowerShell
15 lines
474 B
PowerShell
|
|
$psi = New-Object System.Diagnostics.ProcessStartInfo
|
||
|
|
$psi.FileName = "git"
|
||
|
|
$psi.Arguments = "push"
|
||
|
|
$psi.UseShellExecute = $false
|
||
|
|
$psi.RedirectStandardInput = $true
|
||
|
|
$psi.RedirectStandardOutput = $true
|
||
|
|
$psi.RedirectStandardError = $true
|
||
|
|
$p = [System.Diagnostics.Process]::Start($psi)
|
||
|
|
$p.StandardInput.WriteLine("12345678")
|
||
|
|
$p.StandardInput.Flush()
|
||
|
|
$p.WaitForExit()
|
||
|
|
$output = $p.StandardOutput.ReadToEnd()
|
||
|
|
$err = $p.StandardError.ReadToEnd()
|
||
|
|
Write-Host $output
|
||
|
|
Write-Host $err
|