Hello All,
Am new to the forum & has been ages since I last wrote a script for any platform, but have been tasked with one in PowerShell recently.
In brief:
Running from Server-A (running PS 4.0), I have a listing of server names (700-800) to upload packages to and then execute a PS1 script (from the uploaded packages) on the remote server (Server-X).
Problem #1:
How best should I execute the remote .ps1 script (on Server-X) and can this be done in a Unix style background mode ‘&’?
The remote .ps1 script may take only a few minutes on some servers and take hours on others - hence seeking for a background mode capability.
I was this morning attempting to use …
Start-Process -Filepath "$PSExec" -ArgumentList "\\$Server -h -d $RmtFldr2\test-exec.ps1"
But that isn’t working as I’d hoped.
Problem #2:
Am finding that some of the servers I need to connect to are running PS 2.0 - how best to write the scripts to accommodate varying/unknown PS versions?
Any assistance would be really appreciated.
Cheers,
Cameron