Saving output from cmd while executing a loop

markmaz

Estimable
Nov 18, 2015
1
0
4,510
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)