我得到了这个教程 FTP 上传
#Unique Variables
$FTPServer = "ftp://example.com/"
$FTPUsername = "username"
$FTPPassword = "password"
$LocalDirectory = "C:\temp\"
$FileToUpload = "example.txt"
#Connect to the FTP Server
$ftp = [System.Net.FtpWebRequest]::create("$FTPServer/$FileToUpload")
$ftp.Credentials = New-Object System.Net.NetworkCredential($FTPUsername,$FTPPassword)
#Upload file to FTP Server
$ftp.Method = [System.Net.WebRequestMethods+Ftp]::UploadFile
#Verify the file was uploaded
$ftp.GetResponse()
但在我的 ftp 上我只得到空白文件,为什么?