Question: 8. Write a switch statement that will do the following: Test the status property of an object of type System Service Process Service Controller If

 8. Write a switch statement that will do the following: Test

8. Write a switch statement that will do the following: Test the status property of an object of type System Service Process Service Controller If the status is stopped, write the service name followed by" is stopped". An example of the output is: wuauservis stopped If the status is running, write the service name followed by " is running". An example of the output is: wuauservis running If the status is anything else, use Write-Host to write the service name followed by " is not running or stopped". An example of the output is: wuauser is not running or stopped In order to test your code, use the following code and put the switch statement inside the foreach loop: $services = Get Service foreach ($service in $services) { ******* put switch statement here ********* PowerShell command: 8. Write a switch statement that will do the following: Test the status property of an object of type System Service Process Service Controller If the status is stopped, write the service name followed by" is stopped". An example of the output is: wuauservis stopped If the status is running, write the service name followed by " is running". An example of the output is: wuauservis running If the status is anything else, use Write-Host to write the service name followed by " is not running or stopped". An example of the output is: wuauser is not running or stopped In order to test your code, use the following code and put the switch statement inside the foreach loop: $services = Get Service foreach ($service in $services) { ******* put switch statement here ********* PowerShell command

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!