out-file help

The generally accepted best practice is to use Write-Output for objects that your script is returning, and Write-Verbose for any “screen-only” feedback. If your script’s only output is intended to be on the screen, rather than being assigned to a variable or piped to another command, then you can also just use Write-Output in place of either Write-Host or Write-Verbose. This makes it easy to redirect your script’s output with the redirection operators, Out-File, etc.