Search code examples
javascriptpowershellvirtual-machinewebdriver-io

How to minimize a specific window in a remote VM using powershell - For Automation test suit


I am wondering if there is a command in Powershell to minimize a specific window (Eg: notepad || cmd.exe) in a remote machine. I have tried the following commands, these worked in my local machine but don't seem to be for remote Vms.

(New-Object -ComObject Shell.Application).MinimizeAll()


Get-Process | Where-Object {$_.MainWindowTitle -ne ""} | Select-Object MainWindowTitle

Solution

  • https://gist.github.com/Nora-Ballard/11240204 has Powershell code that will do window manipulation by MainWindowHandle, which you can get from Get-Process.