zhangjian/push3.ps1

15 lines
478 B
PowerShell
Raw Normal View History

$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()
$error = $p.StandardError.ReadToEnd()
Write-Host $output
Write-Host $error