How to stop powershell Job in different cmd instance -
I am currently writing a power-shell script which continually monitors system performance on many infinite servers, just an infinite loop Through this.
register-scheduled-job -name $ machine_name -scriptblock $ cmd -Assetment list $ ip_address, $ machine_name, $ cred -RunNow start-job -name -name $ machine_name This is the code that I use to register the fixed jobs, and it is located in the initial script to me. Another example of CDD / PowerShell (aka pitch in another script) Call stop-job There is no way? I have to hook up a powerhole for a web interface, and ideally clicking a button on that interface will run a small script which is called stop-job at the beginning of the previously mentioned work.
apaike, you can not do this You can not share the status between two different console instances / sessions Even if you look at the Windows PowerShell background jobs running in Current Sessions , then Go to the Go-Job Commandlet in MSDN. Therefore, if you run a job in console 1 and if you try get-job in console 2; This will not display any job results because it is not present in that session. You must use stop-job on the same session / console.
Comments
Post a Comment