PS script (check service status, wait for service to be stopped)
Hey Experts. I need to copy data from a directory on a server (serverA) but a Windows service on the server needs to be stopped before the data is copied. Not sure how to get the script to check for the Windows service (say spooler) to be stopped before the script continues on. Thank you in advance for any help!
*I'm running the script as a scheduled task on my PC so the commands would need to be remote (I'm guessing)