UI that is no longer available error occured by calling .dll method from powershell.

骏 高 1 Reputation point
2022-09-23T15:17:36.82+00:00

I have a powershell script calling about some method of .dll.
When I call the method of the dll, powershell displayed the error below.
"The target element corresponds to UI that is no longer available.(for example, the parent window has closed)."

Question1:
Does this error only mean some control be found before cannot be invoked, for the reason of window be closed?
Any other reason may cause this exception?

Question2:
Besides that, the powershell script still executed although error occured.
Is there something wrong with powershell executing?
Or is there some setting options about powershell executing options?

Question3:
Error such as throwed from .dll can be catched by powershell script or not?
If so, how can I catch the error in powershell script?

Windows Server PowerShell
Windows Server PowerShell
Windows Server: A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.PowerShell: A family of Microsoft task automation and configuration management frameworks consisting of a command-line shell and associated scripting language.
5,389 questions
{count} votes