GEORGE TRIFONOV Home Developer Corner Contact Resume 
Theme
Login
 
 
Powershell logging example or how to redirect output to file by using Write-Output

Few days I got a simple question from one of blog readers regarding how to log in powershell .

In order to redirect your output to file you need to execute script and indicate that output source is file

PS C:\> prototypes\logging.ps1 |Out-File C:\prototypes\ps.log

In your script use command Write-Output to write anything to your current output :)

Write-Output "Test"

Share this post: email it! | bookmark it! | digg it! | kick it! | live it!
Posted: Fri, 20 Feb 2009 13:08:59 GMT By: Gtrifonov