Powershell script works now

This commit is contained in:
mterwoord_cp 2007-12-29 10:46:49 +00:00
parent c3d44fd40c
commit 5118e18dc8

View file

@ -31,8 +31,33 @@ cd ..\..\..\tools\qemu\
$qemu = resolve-path qemu.exe
$qemuparms = '-L . -cdrom ..\..\build\Cosmos\ISO\Cosmos.iso -boot d -hda ..\..\build\Cosmos\ISO\C-drive.img -serial "file:..\..\build\Cosmos\ISO\serial-debug.txt" -S -s'
# Still failing - because its a command line exe? run under cmd.exe?
[System.Diagnostics.Process]::Start($qemu, $qemuparms)
$processInfo = new-object System.Diagnostics.ProcessStartInfo
$processInfo.FileName = $qemu
$processInfo.WorkingDirectory = [System.IO.Path]::GetDirectoryName($qemu);
$processInfo.Arguments = $qemuparms;
$processInfo.UseShellExecute = $False
$processInfo.RedirectStandardOutput = $False
$processInfo.RedirectStandardError = $False
$process = [System.Diagnostics.Process]::Start($processInfo)
#if(!($process.WaitForExit(60*1000) -and ($process.ExitCode -eq 0)))
#{
# Write-Host $process.StandardOutput.ReadToEnd()
# Write-Host $process.StandardError.ReadToEnd()
#}
[System.Threading.Thread]::Sleep(1000)
cd ..\gdb\bin\
$gdb = resolve-path gdb.exe
$gdbparms = '..\..\..\Build\Cosmos\ISO\output.obj --eval-command="target remote:1234"'
$process2 = [System.Diagnostics.Process]::Start($gdb, $gdbparms);
$process2.WaitForExit()
pause
#http://www.vistax64.com/powershell/114718-how-can-i-execute-wmi-method-asynchronously.html
#http://blogs.technet.com/industry_insiders/pages/executing-a-command-line-utility-from-powershell-and-waiting-for-it-to-finish.aspx
#invoke-item
#invoke-item
if(!$process2.HasExited) {
$process2.Kill()
}
if(!$process.HasExited) {
$process.Kill()
}