Powershell script to ftp folder

Advertisement

cerealkiller
Joined:
Posts:
1

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!

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum