> $startinfo = new-object System.Diagnostics.ProcessStartInfo > $startinfo.FileName = $execBinary > $startinfo.Arguments = $connectParams + $commandParam + $vmxParam + $vpParam > $startinfo.UseShellExecute = $false > $startinfo.RedirectStandardOutput = $true > $process = [http://System.Diagnostics.Process|http://System.Diagnostics.Process]::Start($startinfo) > $process.WaitForExit() > $process.StandardOutput.ReadToEnd() >
I'm not sure based on that, but this style of running vmrun seems a bit over the top. You can run it directly like you would from a command prompt. Is there a reason you didn't do that? I assume it's because of the path. Still you could run it sort of like this:
$vmrun = Get-Command "C:\Program Files\VMware\VMware Server\vmrun.exe" . $vmrun $arg1 $arg2 $arg3
And this might be a bit easier to diagnose.
The reason was because loading a Vprobe with double quotes did not work from the command line. I thought that maybe .NET Framework would handle it a little differently.
I also tried this in CMD:
set probe1 = "'(vprobe VMM1Hz (printf "hello "))'" vmrun ... %probe1%
but failed with this error:
vprobeLoad: error: illegal variable reference in top-level context vprobeLoad: 0 warnings, 1 errors Error: Unknown error
This, however, does seem to work from CMD:
vmrun ... "(vprobe VMM1Hz (printf \"hello\n\" ))"
This, does not:
vmrun ... "'(vprobe VMM1Hz (printf \"hello\n\" ))'"
vmrun ... (printf \"%d\t%d\n\" RAX RSP))"
This, does not:
vmrun ... (printf \"%d %d\n\" RAX RSP))"
This probe loads, but does not produce output to vprobe.out:
"(definteger sptr);(vprobe VMM1Hz ( printf \"%d\t%d\t%d\n\" sptr (+ sptr 8 ) (+ sptr 8 ) ))"
Same with this one, it loads, but no output:
"(defaggr agr 0 0);(vprobe VMM1Hz ( do ( setint str (sprintf \"%s:%d\" \"barf\" 12 ))( aggr agr () () 3)))"
Which is understandable since it is sprintf.