Hello, I have an .exe file which updates an application on various clients. From my Application Server, I start a master script, and then this calls a second script which I use to execute commands on the client. The commands are to test for a directory, test to see if a process is running, write to a log, and if everything is good, I would then like it to kick off my .exe file located on each client to update the application. Everything works except for the execution of the .exe file. I have tried many things, usually I can see the background process in Task Manager, but it shows no CPU. It takes 2 hours to finish (where if I run it manually it is 5-10 minutes) and then none of my files were changed, so it basically does nothing.
I have also updated my master script, getting a list of machines in an array, starting a for loop, and for each item creating a session, followed by the various commands using Invoke-command -computername -session session -scriptblock. The results are the same.
I would like the process to avoid waiting for the first client to update before starting the next, otherwise it will take all night.
On my test client, I set the execution policy for currentuser, localmachine, and process to unrestricted. I can create a ps1 on my test client locally and run it using start-process command, but if I create a master on my client which calls this same test script, I have the same behavior, where either no process starts or a process starts but does nothing. Am I missing a step?
Let me know if a copy of the code would help.