I have a PowerShell script that issues a command like:
$my_exit = invoke-Command -Session $my_session -ScriptBlock { ... } -Args
to execute a long script on a target server.
If the calling script terminates for any reason (maybe, the PC is powered off due to a power failure) the script on the target host terminates as well.
How can I launch a script on a target host so that it continues even if the calling script closes?
I made a test adding the -asjob qualifier with no success.
Regards
marius