I am writing below PS code to run my application.
$ReturnVar = Start-Process $WExe $IFile -NoNewWindow -Wait
Write-Host "Success"
After ran my application $WExe $IFile
successful, script printing "Success".
I have a one challenge here. If my application get stuck and laying down in background, PS code also laying down in background, since I am giving -NoNewWindow -Wait
.
So if my application running time crossing over 30 minutes I want to display/print "Application got stuck in background".