I'm looking for some help if possible. Please bear in mind I am a complete Powershell novice so feel free to dumb things down as appropriate. Also apologies if this is in the wrong section
End Product - Report/CSV to show all "missing files" between an SQL output compared to existing files in a directory - Essentially, what orders are in SQL, compare this to filenames in a directory, any files that are missing needs to be reprocessed
I need to compare an SQL CSV output that is always in a format of 12345 (order number) to a directory search of filenames (pdf's) 12345.pdf
I have managed to create x2 arrays, one to hold the SQL output data, and x1 for the directory searches. However this is the point where I get stuck, it would appear that as people have been saving files, they are appending either a singular '0' or x2 '00'
For example, the SQL export will be 12345, the file (if it exists) could be either 12345.pdf, 012345.pdf or 0012345.pdf
Process so far.
SQL Export - Certain column passed to powershell array (Done)
Directory scan for all *.pdf files, saved into Array (Done)
Compare array, output missing files list (This is where I am stuck due to some files being 12345, or 012345 or 0012345
I can complete the "Compare" job, but as there are "sometimes" 00's in the filenames, they are also exported