1

Below is the powershell script to copy files to to our FTP folder, now encryption has changed to 'Use Explicit FTP Over TLS', how do I modify script with encryption added to it. this script used to work before encryption added.

$FTPHost = "ftp://ftp.com"
$FTPUser = "xxxxx"
$FTPPass = "xxxxxx"
$source = "C:\Test"

$webClient = New-Object System.Net.WebClient
$webClient.Credentials = New-Object System.Net.NetworkCredential($FTPUser, $FTPPass)

$files = get-childitem $source -recurse -force

foreach ($file in $files) {
    Write-Host "Uploading $file"
    $webClient.UploadFile("$FTPHost" + "/" + $file.Name, "STOR", $file.FullName)
}

$webClient.Dispose()
mklement0
  • 382,024
  • 64
  • 607
  • 775
Srikanth P
  • 25
  • 5

0 Answers0