Closed BartVerellen closed 1 year ago
The FileNameCase
is raw "transfer" settings (not "session" settings):
https://winscp.net/eng/docs/rawtransfersettings
Though it seems that the API of the module does not support raw "transfer" settings.
@martinprikryl , thanks for your reply. So it's not possible to use this functionality? Do you know if there is any other way to achieve this? The destination is case sensitive, so we need to copy all folders and files in lowercase. @tomohulk any chance this feature is added?
Ill dig in and see what it will take to get this added.
I added the "RawSettings" parameter to the New-WinSCPTransferOption
cmdlet. It's just hash table, just like the one on the New-WinSCPSessionOption
cmdlet. Looking at that docs I may create 2 new cmdlets New-WinSCPTransferOptionRawSetting
and New-WinSCPSessionRawSetting
and then you can use those "hash table" builder cmdlets.
If you wanna grab from this repo and see if it works for you and let me know, that would be great. It's on my todo list for this week to get this repo cleaned up and get some kinda CI/CD solution set back up so until I get there, it won't be published.
Nevermind, looking at my code, this isn't going to work. I apologize, and ill get it updated today.
Ok, it forsure works now. Mind you I had to set this up with a local transfer, so im using the Local
sync mode. It's kind of a bummer the way the transfer result returns because that doesn't match the actual file name:
I'll get this published out to the gallery today. it will be v5.21.8.10. Let me know if you find any bugs.
Hi,
Many thanks for this! I'll check it out next week. Thanks!
With friendly regards, Bart
Op wo 10 mei 2023 om 16:29 schreef Thomas Malkewitz < @.***>:
Closed #145 https://github.com/tomohulk/WinSCP/issues/145 as completed.
— Reply to this email directly, view it on GitHub https://github.com/tomohulk/WinSCP/issues/145#event-9212451030, or unsubscribe https://github.com/notifications/unsubscribe-auth/A55BOAR4R7TZSAXQH2RAIHDXFOQ3RANCNFSM6AAAAAAVC6X444 . You are receiving this because you authored the thread.Message ID: @.***>
Hi Thomas,
Just wanted to inform you that we finally got the time to implement it here. All is working perfectly!
Thanks for your actions!
Op do 11 mei 2023 om 07:44 schreef Bart Verellen @.***>:
Hi,
Many thanks for this! I'll check it out next week. Thanks!
With friendly regards, Bart
Op wo 10 mei 2023 om 16:29 schreef Thomas Malkewitz < @.***>:
Closed #145 https://github.com/tomohulk/WinSCP/issues/145 as completed.
— Reply to this email directly, view it on GitHub https://github.com/tomohulk/WinSCP/issues/145#event-9212451030, or unsubscribe https://github.com/notifications/unsubscribe-auth/A55BOAR4R7TZSAXQH2RAIHDXFOQ3RANCNFSM6AAAAAAVC6X444 . You are receiving this because you authored the thread.Message ID: @.***>
Please fill in the following fields, replacing the values inside the brackets
{{ }}
.Issue Description
When I try to transfer files all in lowercase, I tried using the RawSetting option via New-WinSCPSessionOption. However it does not work. Files are still being transferred without changing the name to lowercase.
Example
$myCredential = Get-AutomationPSCredential -Name 'SFTP_TESTUSER'
$rawsettings = @{"FileNameCase" = "2"}
$sessionOption = New-WinSCPSessionOption -RawSetting $rawsettings -HostName xx.xx.xx.xx -Credential $myCredential -GiveUpSecurityAndAcceptAnySshHostKey $session = New-WinSCPSession -SessionOption $sessionOption
$transferOptions = New-WinSCPTransferOption -FileMask "|.gif;.jpeg;.jpg;.png;" Sync-WinSCPPath -LocalPath "\c\temp\" -RemotePath "Files/SYNCFOLDER/" -WinSCPSession $session -Mirror -Mode Remote -Criteria Size -TransferOptions $transferOptions
Remove-WinSCPSession
Expected Output
Filenames are send always in lowercase
Actual Output
Filenames are taken from the source, without a change.
WinSCP-PowerShell Version
WinSCP Module 5.21.7.0
Environment
Azure Automation Runbooks -> Powershell 5.1