PowerShell SFTP upload – preserving uppercase filename

Advertisement

rupertbear
Joined:
Posts:
2
Location:
mars

PowerShell SFTP upload – preserving uppercase filename

Hi,
In PowerShell I am having issues with the Send-WinSCPItem not preserving the filename case of a file I'm uploading to a remote SFTP server. Not sure if it's my stupidity....?

So, if $localfile contains say D:\Test\MYFILE

when I run the following
Send-WinSCPItem -WinSCPSession $session -LocalPath $localfile -RemotePath $remotepath
When I check the remote server the filename has been changed to lowercase i.e. myfile instead of MYFILE.

Is there some session option to preserve the case of the file that I'm missing?

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Re: PowerShell SFTP upload – preserving uppercase filename

You are using WinSCP PowerShell module. That's a 3rd party package. We do not maintain it.

Though, I cannot imagine that the module would convert the filename case on its own. Maybe it's a "feature" of your server. Did you test this in WinSCP GUI? Or with WinSCP .NET assembly?

Reply with quote

rupertbear

Solved

Thanks for the reply.
It would appear to be an issue with the PowerShell module as when I use the put command it works fine and when I manually transfer the files that also works fine.

Reply with quote

Advertisement

You can post new topics in this forum