1

I'm trying to run a exe file in a remote machine from PowerCLI which is launching couple of cmd's.

With this command:

$executeCommand = "call D:\MyFile.exe Arg1 Arg2";
Invoke-VMScript -VM $vmName -GuestUser $vmUser -GuestPassword $vmPass -ScriptText $executeCommand -ScriptType Bat;

The problem is that the exe is running but without any UI, And also the CMD's are running and I can't see the console.

Note: When I'm running the same execute command in the VM's the exe is launching with UI and the CMD's with their console.

How can do it properly? should I use another type of "Invoke-VMScript" or some special flags?

  • If you are trying to run a gui app, why not login so the gui has a session open to draw the UI? What's the point of running this remotely? – Jim B Jan 09 '17 at 14:23
  • Automation of a nightly build. This UI program running some process, and let the QA to do some manipulations (UI buttons) and see some logs in the console – Aviram Fireberger Jan 09 '17 at 14:31
  • So how exactly do you automate the fingers pressing the buttons? Have QA install the app properly or fix the app so it only draws the gui when invoked from the shell of the active user. I'm not sure how your going to get around the cmd sessions as they will only show on the session that ran them. – Jim B Jan 09 '17 at 17:25
  • Cross-posted at [stackoverflow.com](http://stackoverflow.com/q/41548085/3439404)? Why? – JosefZ Jan 09 '17 at 19:40

0 Answers0