I want to open a WPF application from remote machine using PowerShell. This is the command I'm using
Invoke-Command -ComputerName "ComputerNamne" -ScriptBlock { & "C:\...App.exe" } -credential "Username"
but for some reason nothing happens
I was able to start the process when calling batch file which calls the applcation
Invoke-Command -ComputerName "ComputerNamne" -ScriptBlock { & "C:\...RubApp.bat" } -credential "Username"
but in this way the GUI is not appearing. I can see in task manager that the app is running though.
So two questions:
- Why can't I run directly the exe file?
- Why the GUI is hidden in the second method. Can I solve this?
invoke-commandor other WinRM methods. If you want to do that, look into usingpsexecwith the-iswitch-i. If you are trying to display in console session 2, you would use:PsExec \\machine -i 2 -d "C:\..App.exe"