winscp-net

Move files after upload using PowerShell/WinSCP Script

无人久伴 提交于 2021-02-08 10:35:14
问题 I am using a PowerShell script generated in WinSCP to sftp files in a certain folder. It runs every Friday morning, but I need it to move the files to another folder after they are uploaded. I tried the MoveFiles and PutFiles command but they don't seem to work. Any help is appreciated. Code below. # Load WinSCP .NET assembly Add-Type -Path "WinSCPnet.dll" # Set up session options $sessionOptions = New-Object WinSCP.SessionOptions -Property @{ Protocol = [WinSCP.Protocol]::Sftp HostName =

WinSCP: Checksum calculation (Operation not supported.)

我只是一个虾纸丫 提交于 2021-02-08 07:36:13
问题 I'm using WinSCP .NET assembly in my C# WinForms application and I want to synchronize my remote directory with my local directory. This works great with WinSCP. But before the synchronisation starts, I want to check if the remote and the locale directors are different at all. To do this, I want to use the CalculateFileChecksum() method from WinSCP. Here is an example for what I'm trying to do. And here is the code, where I call the method: var checksum = session.CalculateFileChecksum("md5",

WinSCP: Checksum calculation (Operation not supported.)

怎甘沉沦 提交于 2021-02-08 07:35:22
问题 I'm using WinSCP .NET assembly in my C# WinForms application and I want to synchronize my remote directory with my local directory. This works great with WinSCP. But before the synchronisation starts, I want to check if the remote and the locale directors are different at all. To do this, I want to use the CalculateFileChecksum() method from WinSCP. Here is an example for what I'm trying to do. And here is the code, where I call the method: var checksum = session.CalculateFileChecksum("md5",

PowerShell script to copy files but not subfolders to SFTP and move to subfolder once done

筅森魡賤 提交于 2021-02-08 02:12:25
问题 I am using the following script to copy files from my local folder to SFTP. Once I upload the file I then want to move the file to a subfolder. I want to upload only files in the C:\Users\Administrator\Desktop\ftp folder, and not files in the other subfolders. param ( $backupPath = "C:\Users\Administrator\Desktop\ftp\moved" ) # Load the Assembly and setup the session properties try { # Load WinSCP .NET assembly Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll" $session = New-Object

PowerShell script to copy files but not subfolders to SFTP and move to subfolder once done

穿精又带淫゛_ 提交于 2021-02-08 02:11:23
问题 I am using the following script to copy files from my local folder to SFTP. Once I upload the file I then want to move the file to a subfolder. I want to upload only files in the C:\Users\Administrator\Desktop\ftp folder, and not files in the other subfolders. param ( $backupPath = "C:\Users\Administrator\Desktop\ftp\moved" ) # Load the Assembly and setup the session properties try { # Load WinSCP .NET assembly Add-Type -Path "C:\Program Files (x86)\WinSCP\WinSCPnet.dll" $session = New-Object

How to fix NuGet WinSCP.NET in SSIS Script Task?

ε祈祈猫儿з 提交于 2020-12-31 05:20:43
问题 I'm trying to use the WinSCP.NET NuGet to upload some files to an SFTP through a Script Task component in SSIS. While writing the code everything went fine, but if after attempting to build, the WinSCP.NET dll seems to not be picked up breaking all of the references. I've tried adding WinSCP path to my PATH variable (user). I've tried to add the local version of the WinSCPNET.dll to the GAC. I've tried to reinstall the package through NuGet. I've even tried to change the framework versions.

Copy files to FTP and archive with today's date

最后都变了- 提交于 2020-12-06 07:52:46
问题 I need to create a script that does the following: Copies all files in a folder to an FTP site. If the copy was successful move the files to an archive. The archive should be a freshly created folder with today's date (so we know when they were transmitted). I've tried to cannibalise other scripts to get something to work but I'm not getting anywhere so I need some help I've been working on this for hours. I'm using the WinSCP DLL only because my other (working) script uses SFTP which needs

Copy files to FTP and archive with today's date

杀马特。学长 韩版系。学妹 提交于 2020-12-06 07:52:20
问题 I need to create a script that does the following: Copies all files in a folder to an FTP site. If the copy was successful move the files to an archive. The archive should be a freshly created folder with today's date (so we know when they were transmitted). I've tried to cannibalise other scripts to get something to work but I'm not getting anywhere so I need some help I've been working on this for hours. I'm using the WinSCP DLL only because my other (working) script uses SFTP which needs

How do I use DTS.Events.FireInformation() in SSIS Script Task while handling WinSCPnet.dll FileTransferProgress?

六月ゝ 毕业季﹏ 提交于 2020-12-06 04:07:35
问题 I have a Script Task in an SSIS (2008) package that downloads files from a remote FTP server to a local directory. The Script Task is written in C# 2008, and uses WinSCPnet.dll. Using examples from WinSCP's documentation, I came up with the script below. The script functions correctly to download the files, but all the file success/failure messages are held until the entire script completes, and then all the messages are dumped at once. File progress is not displayed at all using Console

How do I use DTS.Events.FireInformation() in SSIS Script Task while handling WinSCPnet.dll FileTransferProgress?

三世轮回 提交于 2020-12-06 04:06:38
问题 I have a Script Task in an SSIS (2008) package that downloads files from a remote FTP server to a local directory. The Script Task is written in C# 2008, and uses WinSCPnet.dll. Using examples from WinSCP's documentation, I came up with the script below. The script functions correctly to download the files, but all the file success/failure messages are held until the entire script completes, and then all the messages are dumped at once. File progress is not displayed at all using Console