I want to launch a long-running remote program but don't want to wait. So I put below one line command in PS script file and run "Powershell -file xxx.ps1"
Invoke-command server1 {xxx.exe} -AsJob
But the remote program is not running after the script run, but if I run above command in PS console interactively, remote program running ok. Seems the program is killed when script terminates.
Why is this?
UPDATE
If I sleep 1 second at end of script, the remote app running fine.