I am currently working on automatic installation of a GUI application using the UIAutomation PS Extensions library ( https://uiautomation.codeplex.com/ ). It works very well in cases where I run it against an existing Windows user session. I run my PS script, it opens a window, and I can click on the buttons and so on.
However, the problem occurs when this library is called from a remote machine. I invoke my script (which should open the GUI window and start controlling it) through PsExec from a remote machine. This leads to the fact that the script cannot open the GUI window on the remote computer and begins to throw various exceptions.
As a workaround for this, I can get PsExec to connect to a specific existing session on the remote host, but unfortunately this is unstable since I cannot guarantee the existence of the session.
Does enyone know whether it is possible to force PowerShell to open a new session (interactive graphical interface) with which I could invoke UIAutomation commands?
Thanks in advance to Matthew
powershell automation ui-automation psexec microsoft-ui-automation
Matthew lowe
source share