Is it possible to disable the "encrypt new file" feature when loading files to a SFTP via PS Script

Advertisement

desmondkan
Joined:
Posts:
3
Location:
95051

Is it possible to disable the "encrypt new file" feature when loading files to a SFTP via PS Script

as subject.

I have a powershell script that does the upload some pgp files to a SFTP site. the other party is having issues to open the pgp files and I noticed the winscp does "encrypt new file" by default. My question ... is it possible to disable the feature of "encrypt new file" in the powershell script? i believe there are some switch or command lines that I can specify in the powershell to disable it ?

my winscp version is 5.17.1 (build 10240).

Thanks for your help in advance.
-d

Reply with quote

Advertisement

desmondkan

Is it possible to disable the "encrypt new file" feature when loading files to a SFTP via PS Script

yes, I noticed it has "encrypt new file" feature as a default option. I also know it has nothing to do with PGP files. My situation is that I use PowerShell script to initiate winscp to do the upload and my question is it possible to disable "encrypt new file" in the powershell script so winscp will do the job without the feature of "encrypt new file" ?

Reply with quote

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

Re: Is it possible to disable the "encrypt new file" feature when loading files to a SFTP via PS Script

See https://winscp.net/eng/docs/rawtransfersettings#encryptnewfiles
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.AddRawSettings("EncryptNewFiles", "0")
$session.PutFiles($source, $dest, $False, $transferOptions).Check()
WinSCP GUI can generate such code template for you:
https://winscp.net/eng/docs/guide_automation#generating

Reply with quote

desmondkan

Is it possible to disable the "encrypt new file" feature when loading files to a SFTP via PS Script

got it. thanks for sharing the info.

I will give it a try ... thanks Martin :)

Reply with quote

Advertisement

You can post new topics in this forum