Saving output from cmd while executing a loop

markmaz

Estimable
Nov 18, 2015
1
0
4,510
0
Trying to dump the contents of this command into a file

Get-Service -DisplayName Corr* | ForEach-Object{Write-Host $_.Status : $_.Name}

We get the output to the screen
Stopped : ????
Stopped : ???

but can't get the output written to a file. Been searching the forum but haven't come across anything that works.

Also this is on Windows Server 2012 (option wasn't listed in the drop down)
 
Thread starter Similar threads Forum Replies Date
O Apps General Discussion 1
W Apps General Discussion 1
K Apps General Discussion 2
J Apps General Discussion 2
henrytcasey Apps General Discussion 8
S Apps General Discussion 3
M Apps General Discussion 1
T Apps General Discussion 4
TeaSponge Apps General Discussion 1
C Apps General Discussion 1
A Apps General Discussion 2
J Apps General Discussion 1
R Apps General Discussion 3
clutchc Apps General Discussion 2
I Apps General Discussion 1
J Apps General Discussion 5
S Apps General Discussion 1
V Apps General Discussion 11
Jmurph01 Apps General Discussion 1
viveknayyar007 Apps General Discussion 0

ASK THE COMMUNITY