How use FTP with the TLS protocol
Hello
Please,
I have never used WinSCP
and how include the TLS protocol and run with WinSCP?
Thanks for your help
Arnold
The script is:
Please,
I have never used WinSCP
and how include the TLS protocol and run with WinSCP?
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls
Arnold
The script is:
cls $Xa = (Get-Host).UI.RawUI $Xa.WindowTitle = "Sync Folder To Ftp" $Xftp = "ftp://perso-ftp.orange.fr/" # $Xftp.UsePassive = $true # $Xftp.EnableTls = $true $XlocalDirectory = Get-Content "c:\studio\" $Xuser = "............." $Xpass = "............." $Xwebclient = New-Object System.Net.WebClient $Xwebclient.Credentials = New-Object System.Net.NetworkCredential($Xuser,$Xpass) $XFiles = Get-ChildItem -Path "c:\studio\*" -Rec -For | ? {$_.LastWriteTime -gt (Get-Date).AddHours(-1)} | where { ! $_.PSIsContainer } | Select-Object FullName $Xnombre = $XFiles.Count foreach ($XFile in $XFiles) { $XLocalFile = $XFile.FullName $XRemoveDirectory = $XLocalFile.Replace("C:\studio\","") $XChangeSlashes = $XRemoveDirectory.Replace('\','/') $XRemoveSpaces = $XChangeSlashes.Trim() $XRemoteFile = $Xftp+$XRemoveSpaces $Xuri = New-Object System.Uri("$XRemoteFile") $Xwebclient.UploadFile($Xuri, $XLocalFile) Write-Host "Getting $XFile from $XlocalDirectory" -Foreground "Red" -BackgroundColor DarkBlue Write-Host "Puting $XFile to $Xftp" -Foreground "Yellow" -BackgroundColor DarkBlue } "" Write-Host "Finished Sync to $Xftp" -Foreground "Green" -BackgroundColor DarkBlue "" $Xnombre.ToString() + " File sync -- END -- " + (Get-Date) $Xtext1 = $Xnombre.tostring() + " File sync -- END -- " + (Get-Date)