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

cerealkiller

Powershell script to ftp folder

Hello,

I just installed winscp, and tried the following ftp script.
Add-Type -Path "C:\program files\ (x86)\winscp\WinSCPnet.dll"
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.ParseUrl("ftp://johntales:talespass@ftp.azure.com/")
 
$session = New-Object WinSCP.Session
$session.Open($sessionOptions)
 
$session.PutFiles("E:\website\*", "/site/root").Check()
 
$session.Dispose()

Which copies the folder and subfolders over. But is there a way to display the files that are copied in the powershell command, so I can see at what file he is copying. (so I can see the progress in the powershell window?)

Does this script list failures, if it somehow cant copy a filer/folder? Or list success or fail at the end?

thanks!