Author Posts

January 30, 2017 at 2:58 am

Howdy guys!

Hope you are all doing well. I have a question about services. I have this set of condition below and I was able to do number 1 but having difficulties with 2-4. Sorry just starting out, trying to practice just started college and have a few assignments 🙁

1. If any or all of the services that start with letter “W” are running, stop them

2. If confirm that all the services are stopped, reboot the computer

3. Verify if the computer successfully reboot

4. Verify if all the services are running after reboot

Thanks for your help!

January 30, 2017 at 5:41 am

Hi, I dont want you to provide full code-blocks. But I can give you some Informations where you can have to go deeper.

2. Get the Status of the Services, three hints: Get-Service, Status, Where
3. Grab the Last boot time from an CIM-Instanc, two hints: Get-CimInstance, LastBootUptime
4. Do the same like in step 2

Hope, that will help you out.
If you have some code, we can go further with this, but some of the task you have to do 🙂

BR,
BBC

January 30, 2017 at 10:27 am

Thanks BLackbox let me get on with it then! 🙂

Will get back once I have constructed the code.