I am not experienced with PowerShell and I need help to download several images with similar names from an FTP server. I found a lot in this forum, and I only managed to download one picture. For this I had to enter the name of the file.
I would like to select a date and then download all the pictures with this date and save them in a local folder.
I would also like to save the names of the downloaded images in a .txt file
So how can I download the pictures based on the date?
The string 20201009
is the date and the numbers after it are sequential.
I hope you understand what I mean, because it is my first time that I write something in the forum
$UserName = "abc"
$Password = "abc"
$RemoteFileName = "DatenTestKam3_schlecht_20201009_085248_00848.jpg"
$LocalFilePath = "C:UsersDesktopPowerShell$RemoteFileName"
$ServerName = "10.196.195.167/22_test"
$webclient = New-Object System.Net.WebClient
$webclient.Credentials = New-Object System.Net.NetworkCredential($UserName, $Password)
$uri = New-Object System.Uri(“ftp://$ServerName/$RemoteFileName”)
$webclient.DownloadFile($uri, $LocalFilePath)
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…