0

I have few .net console apps which i want to start remotely using Powershell.

Using Start-Process I am able to start the application, however they run in the background so I do not see the app console to check for any error.

Is there a way to run the application in foreground using PS?

henrycarteruk
  • 12,708
  • 2
  • 36
  • 40
Parth Gandhi
  • 311
  • 8
  • 16
  • 1
    You can use the `-WindowStyle` parameter of the `Start-Process` cmdlet to maximize the process which you have started and bring it to the foreground. For example, `Start-Process -FilePath "notepad" -Wait -WindowStyle Maximized` – Vivek Kumar Singh Feb 28 '18 at 13:00
  • This works from local machine. I am trying using invoke-command to run it from remote machine. – Parth Gandhi Feb 28 '18 at 14:25
  • Apologize for not being clear in the actual post. – Parth Gandhi Feb 28 '18 at 14:25
  • 1
    See [this](https://social.technet.microsoft.com/Forums/office/en-US/8f4e2ed8-9577-484c-97db-16394c84f912/executing-foreground-task-on-remote-computer?forum=winserverpowershell) and [this](https://stackoverflow.com/questions/18748349/powershell-using-start-process-in-pssession-to-open-notepad). – Vivek Kumar Singh Feb 28 '18 at 14:43
  • 1
    Possible duplicate of [Powershell Using Start-Process in PSSession to Open Notepad](https://stackoverflow.com/questions/18748349/powershell-using-start-process-in-pssession-to-open-notepad) – henrycarteruk Feb 28 '18 at 17:31

0 Answers0