Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

tredjejuni

Re: Syncronize Directories with Powershell - write log to file?

martin wrote:

To append to a file, instead of overwriting it, use >> instead of the >:

Write-Output ("Download of {0} succeeded" -f $e.FileName) >> C:\backuptest\log.txt


Many Thanks!!! It worked great! :D
martin

Re: Syncronize Directories with Powershell - write log to file?

To append to a file, instead of overwriting it, use >> instead of the >:

Write-Output ("Download of {0} succeeded" -f $e.FileName) >> C:\backuptest\log.txt
tredjejuni

Syncronize Directories with Powershell - write log to file?

Hi,

I have got this powershell script example to work really great!
https://winscp.net/eng/docs/library_session_synchronizedirectories#powershell

But I would like the output information in a file in stead of on the screen.

I have tried almost everything in Powershell but without success. Only the last file transfer is seen in the file if I use
Write-Output ("Download of {0} succeeded" -f $e.FileName) > C:\backuptest\log.txt


How can I get the full log into the file? Preferrably a new line for each message. :?:

Thanks for any advice![/code]