Get files starting with a specific name
I've searched all over and can find pieces of what I need, but not the whole thing.
I'm using PowerShell to script checking whether a file exists and then download it. Every month, two new files come in that I need to pull. They begin with the same phrase but end based on the month of the year and then have a timestamp before the file extension.
So right now, I have the following file on the server:
Report_rptTotalMilesAndRanks_20160916111841_Final.csv
That one has been processed. I need to get the new file when it comes online, which will have the following portion of the filename stable:
Report_rptTotalMilesAndRanks_201610*Final.csv
Where the * is in the filename would be the date, year, and time the file was generated.
How on earth do I tell WinSCP to look for a file beginning with "Report_rptTotalMilesAndRanks_201610" and ending in "Final.csv" with a wildcard in between?
I'm using PowerShell to script checking whether a file exists and then download it. Every month, two new files come in that I need to pull. They begin with the same phrase but end based on the month of the year and then have a timestamp before the file extension.
So right now, I have the following file on the server:
Report_rptTotalMilesAndRanks_20160916111841_Final.csv
That one has been processed. I need to get the new file when it comes online, which will have the following portion of the filename stable:
Report_rptTotalMilesAndRanks_201610*Final.csv
Where the * is in the filename would be the date, year, and time the file was generated.
How on earth do I tell WinSCP to look for a file beginning with "Report_rptTotalMilesAndRanks_201610" and ending in "Final.csv" with a wildcard in between?