小编use*_*565的帖子

PowerShell连接到FTP服务器并获取文件

$ftpServer = "ftp.example.com"
$username ="validUser"
$password ="myPassword"
$localToFTPPath = "C:\ToFTP"
$localFromFTPPath = "C:\FromFTP"
$remotePickupDir = "/Inbox"
$remoteDropDir = "/Outbox"
$SSLMode = [AlexPilotti.FTPS.Client.ESSLSupportMode]::ClearText
$ftp = new-object "AlexPilotti.FTPS.Client.FTPSClient"
$cred = New-Object System.Net.NetworkCredential($username,$password)
$ftp.Connect($ftpServer,$cred,$SSLMode) #Connect
$ftp.SetCurrentDirectory($remotePickupDir)
$ftp.GetFiles($localFromFTPPath, $false) #Get Files
Run Code Online (Sandbox Code Playgroud)

这是我从FTP服务器导入文件的脚本.
但是我不确定是什么remotePickupDir,这个脚本是否正确?

ftp powershell

14
推荐指数
3
解决办法
10万
查看次数

标签 统计

ftp ×1

powershell ×1