Closed Gaz2600 closed 4 years ago
Lets see if we can figure this out, I haven't seen this exact issue, I also don't have an AWS sub, so its going to be hard for me to test.
first, can you update to the latest WinSCP PowerShell Module Version, 5.17.2.0, you are quite a few versions behind.
if you downloaded it from the powershell gallery, just do Update-Module WinSCP
else you can grab it from the releases section here on the project page.
next, try just using the transfer options, I don't think you need to change the permissions at all
$transOptions = New-WinSCPTransferOption -PreserveTimestamp:$false
lte me know how it goes. thanks.
That appears to have allowed the transfer when I ran a small portion of the script but running the entire script I now get a new error:
`New-WinSCPSession: Exception calling "Open" with "1" argument(s): "The version of C:\Program Files\WindowsPowerShell\Modules\WinSCP\5.17.2.0\Public..\bin\winscp.exe (5.17.2.0) does not match version of this assembly C:\Program Files\WindowsPowerShell\Modules\WinSCP\5.13.9.1\lib\WinSCPNet.dll (5.13.9.0)." At E:\ParentSquare\PS\ParentSquare.ps1:51 char:16
+ CategoryInfo : NotSpecified: (:) [New-WinSCPSession], MethodInvocationException
+ FullyQualifiedErrorId : SessionLocalException,New-WinSCPSession`
you need to close and reopen your console, the old dll is still loaded. you can also just go delete C:\Program Files\WindowsPowerShell\Modules\WinSCP\5.13.9.1
if you want to be sure
ah excellent, easy fix. everything appears to be working now, thank you!
hey no problem, glad its working for you!
Please fill in the following fields, replacing the values inside the brackets
{{ }}
.Issue Description
We have a new service whos sftp server is giving me an error when uploading "error occurred while setting the permissions and/or timestamp.**" from what I've found you need to use new-winscptransferoption and new-winscpitempermission however I've not been able to get them to work
Example
Expected Output
{{ Please provide what expect to happen. }}
Actual Output
{{ Please provide what actually happened. }}
WinSCP-PowerShell Version
Version 5.13.9.1
Environment
Windows 2019 Datacenter 64 bit
Name : Windows PowerShell ISE Host Version : 5.1.17763.1007 InstanceId : 4f74bab2-88e8-451b-ac18-0396ca43d083 UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : en-US CurrentUICulture : en-US PrivateData : Microsoft.PowerShell.Host.ISE.ISEOptions DebuggerEnabled : True IsRunspacePushed : False Runspace : System.Management.Automation.Runspaces.LocalRunspace
The FTP server is managed AWS SFTP server