使用psftp管理ftp上传下载
#安装PSFTP模块 Install-Module psftp Get-Module psftp -ListAvailable Import-Module psftp $UserName = "ftpuser" $Password = "ftppassword" $userPassword = ConvertTo-SecureString -String $Password -AsPlainText -Force $cred = New-Object System.Management.Automation.PSCredential($UserName,$userPassword ) Set-FTPConnection -Credentials $cred -Server 10.0.1.7 -UsePassive Send-FTPItem -Path ftp://10.0.1.7/CAB -LocalPath D:\a.zip -Overwrite