We used the following link to monitor the FTP folder and download files from it:https://jhonatantirado.wordpress.com/2013/12/18/download-and-delete-files-from-ftp-using-powershell/
I need to download only .xml .
.xml
I am very new to PowerShell, nothing simple that I am missing?
if ($line -ne ''| $_.extension -eq '.bpxml-2014' -or $_.extension -eq '.xml') { }
$line has my filename with the extension. How to check if it has an extension?
$line
Windows includes an FTP command line client. It can be launched using the script command. Use the -s switch to specify a script file.
-s
A command like mget *.xml should be a good start.
mget *.xml
Using
if ($line -Like "*.xml" -or $line -Like ".bpxml-2014") { ... }
See PowerShell comparison operators .
Alternatively, see (my) solution using the WinSCP.NET assembly used in the PowerShell script:List of files matching the pattern
And just upload the appropriate files using Session.GetFiles .
Session.GetFiles
Source: https://habr.com/ru/post/983160/More articles:C ++ template callbacks with function pointer - c ++Constant orbit speed around a point using SKNode - swiftRemove breakpoints from field in Notepad ++? - notepad ++Check File Extension - powershellSmooth animation while animating CALayer shadowPath - iosAdd invitation code for development - ruby-on-railsConnecting to the Meteor Database - mongodbRails - ElasticSearch - Multiple indexes in one model - ruby-on-railsAssociated "external" class model with colloid sqlalchemy - pythonDoes Sails.js or Meteor.js work with ArangoDB or OrientDB? - meteorAll Articles