What's the best way to automate secure FTP in PowerShell?

前端 未结 9 1609
闹比i
闹比i 2020-12-04 14:32

I\'d like to automate the FTP download of a database backup file using PowerShell. The file name includes the date so I can\'t just run the same FTP script every day. Is t

9条回答
  •  借酒劲吻你
    2020-12-04 15:23

    Taken from here

    $source = "ftp://ftp.microsoft.com/ResKit/win2000/dureg.zip"
    $target = "c:\temp\dureg.zip"
    $WebClient = New-Object System.Net.WebClient
    $WebClient.DownloadFile($source, $target)
    

    Works for me

提交回复
热议问题