Monday, January 19, 2009

list services to a text file

[] to output a table containing the names of running services to a file named 'RunningServices.txt'

PS R:\> get-service -ServiceName * |
>> where-object { $_.status -eq "running" } |
>> format-table ServiceName, Status |
>> out-file -filePath "r:\RunningServices.txt"
>>

[] to open with Notepad

PS R:\> .\RunningServices.txt

No comments:

Post a Comment