Jump to content

Which Powershell command in the PowerCLI module for VMware ESX used to interact with UI apps?


ur
 Share

Recommended Posts

Which Powershell command in the PowerCLI module for VMware ESX used to interact with UI apps?

 

When I launch any exe/any exeutable using powercli on guest VM using powercli command.

Invoke-VMScript, I am able to run them in the background but not in the foreground.

 

i.e., UI apps are not launching but showing the background as running in the task manager.

 

We need our UI Automation scripts to execute in the VM, but it is not working.

 

We are able to do in virtualbox and hyper-v but not in vmware esx using powercli.

 

Please suggest.

Link to comment
Share on other sites

  • Moderators

As is clearly stated in the docs, Invoke-VMScript is meant to run background tasks, not foreground. If your script requires a GUI it will not work.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

Not in PowerCLI, no. Even PS Remoting will only open an interactive shell. Why run something remotely if you're going to be using a GUI? I'm trying to think of a scenario where you would do this; the whole point of remote execution is to get away from that. 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

My autoit script contains gui testing of our windows desktop application.Where we check different features of our product from its UI.

This autoit exe, which we wrote for testing the UI, will be copied to esx test vm using copy commandlet of powercli.

And this script I am launching from invoke-vmscript.

Which is not opening the gui in foreground.

Any alternative in autoit to interact with foreground process when running in background?

 

 

Link to comment
Share on other sites

  • Moderators

So you're going from powershell to AutoIt? 🤮

Have you tried just setting up a scheduled task to run the script?

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators

So jenkins to powershell to AutoIt - I hope this is not a production pipeline you're trying to run like this.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • 2 weeks later...
On 12/18/2019 at 4:41 AM, JLogan3o13 said:

So jenkins to powershell to AutoIt - I hope this is not a production pipeline you're trying to run like this.

Do you think it is a bad practice to have multiple environments involved?

Because, there is no UDF to control vms, so powershell is required here.

And, no UDF to have CI, so using Jenkins

Link to comment
Share on other sites

  • Moderators

In most cases, I would say that mixing languages is a bad practice, yes. Since PowerShell (PowerCLI) can do everything you want with VMware, and also works nicely with jenkins (there are even a number of articles out there about making PS your orchestrator and bypassing jenkins altogether) I guess I don't understand the need for AutoIt. Again, you know your requirements better than I.

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...