Is there a way to "invoke-command" to a remote computer such that I can reboot my computer and the job will still be running, and I can check the output log whenever I want?
PS> invoke-command -Computer Remote1 -File "ScriptThatRunsFor7days.ps1"
PS> restart-computer
PS> # Hey where's my job on remote computer? Can i see it running and connect to
# its output after rebooting my computer?
Isn't it easier to just register a scheduled task that runs the script on the remote computer? For logging just use the cmdlet Start-Transcript at the top of the script. I made a script not to long ago to easely register scheduled tasks on a remote computer. Maybe you can try out and see if it works for you?
Usage: