Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Can't change Color of listed Services in PowerShell 3.0

$
0
0

Hello there,

I have a Challenge in PowerShell 3.0. I'd like to have my services listed with get-service and also i want all the 'stopped' services marked red and all the 'running' services marked green. here's what i wrote:

get-service | foreach-object if ($_.status -eq "stopped") write-host {$_.status -foregroundcolor "red"}

I have been working on the commands for hours but i never got a working result. This challenge is from the Microsoft Virtual Academy Powershell course for beginners part one, so I don't have any experience yet with Powershell at all! This is why i hope this might be quite easy for You guys to solve!

Thanks for Your support! :)



Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>