8 Replies Latest reply on May 29, 2009 1:12 PM by fixitchris

    VProbes in PowerShell

    fixitchris Expert

      I am running into the same issue with PS that I ran into with CMD.  Any ideas?

       

      vprobeLoad: error: EOF while looking for ')'
      vprobeLoad: 0 warnings, 1 errors*
      Error: Unknown error
      

       

       

      $execBinary = new-object System.String "C:\Program Files\VMware\VMware Server\vmrun.exe"
      $connectParams = new-object System.String "-T server -h https://localhost:8333/sdk -u user -p pass "
      $commandParam = new-object System.String "vprobeLoad "
      $vmxParam = new-object System.String '"[standard] store\Windows Server 2003 Standard Edition.vmx" '
      $vpParam = @"
      '(vprobe VMM1Hz (printf "hello "))'
      "@
      
      $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()  
      

       

       

      vmrun vprobeLoad my.vmx '(vprobe VMM1Hz (printf "hello!\n"))'

      The cmd command tool on Windows permits nesting of like‐type quotes only, either single or double quotes

      but not both, so the above vmrun command produces the error message “unknown ident windows” and fails.

      You probably want to install Cygwin so you can run VP scripts in a standard bash shell.