I’m trying to find the last month file in a specific directory by using the modified date. I am currently able to get the latest file in the directory with this snippet: Directory.EnumerateFiles(JsonConfigOut(“NetworkDrive”).ToString(),JsonConfigOut(“ProjectIDInputFile”).ToString,SearchOption.TopDirectoryOnly).OrderByDescending(Function(x) New FileInfo(x).CreationTime).Take(1)
However, is there a way to get the file with the latest modified date from the previous month? For example, if I ran the script today (10/23), I would like to grab the file with the modified date of 9/30. Thanks!