VMware Cloud Community
viknesh18
Contributor
Contributor

Issue running an exe file with arguments on multiple virtual machines in a parallel way

Hi All,

I'm trying to run a .exe file with parameters on multiple virtual machines in parallel fashion. But when I execute the below command on a remote machine, it waits until the job is complete.

Is there a better command so that I can execute the exe command on all the virtual machines parallelly.

Invoke-Command -ComputerName $IPAddress -Credential $credentials -ScriptBlock {& "C:\Users\Administrator\Desktop\scripts\sample.bat"}

The sample.bat file has the command with arguments.

Thanks

Viknesh

0 Kudos
2 Replies
T180985
Expert
Expert

Is it possible to use "-RunAsync"?

Please mark helpful or correct if my answer resolved your issue. How to post effectively on VMTN https://communities.vmware.com/people/daphnissov/blog/2018/12/05/how-to-ask-for-help-on-tech-forums
0 Kudos
LucD
Leadership
Leadership

If you have VMware Tools installed on these stations, you can use the Invoke-VMScript cmdlet with the RunAsync switch.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos