Multiple exclude rule
Posted: Wed Jun 27, 2018 11:58 am
I have a requirement to exclude files based on year, country name and last modified date from that particular year and rest files from that particular year and the country moved to an archive folder
for an example
SS_MM_Master_finland_2018.xlsx last modified date 27/06/2018 19:00.
SS_MM_Master_finland_2017.xlsx last modified date 27/06/2017 19:00.
in this case, same country and year is different in the file name so that particular year- last modified date would be excluded so both the files will be excluded
wants to know if someone can give a small example based on their experience...not necessary to be from above example or any multiple exclude rule or anything contribution would be appreciated
I have tried
$Files = Get-ChildItem -File C:\Setup | select Name, LastWriteTime
You then have an export of the files like:
Name ..............................................LastWriteTime
---- -------------
SS_MM_Master_Germany_2017.txt ..........6/27/2017 4:30:09 PM
SS_MM_Master_Germany_2017.txt ..........6/26/2017 4:30:09 PM
SS_MM_Master_Germany_2018.txt ...........6/27/2018 4:30:09 PM
SS_MM_Master_Germany_2018.txt ...........6/27/2018 4:30:09 PM
till SS_MM_Master format is same and countryname may change based on users...expecting any dynamic query which consider country name as different string check max(modified date) based on year...any small example help appreciated
for an example
SS_MM_Master_finland_2018.xlsx last modified date 27/06/2018 19:00.
SS_MM_Master_finland_2017.xlsx last modified date 27/06/2017 19:00.
in this case, same country and year is different in the file name so that particular year- last modified date would be excluded so both the files will be excluded
wants to know if someone can give a small example based on their experience...not necessary to be from above example or any multiple exclude rule or anything contribution would be appreciated
I have tried
$Files = Get-ChildItem -File C:\Setup | select Name, LastWriteTime
You then have an export of the files like:
Name ..............................................LastWriteTime
---- -------------
SS_MM_Master_Germany_2017.txt ..........6/27/2017 4:30:09 PM
SS_MM_Master_Germany_2017.txt ..........6/26/2017 4:30:09 PM
SS_MM_Master_Germany_2018.txt ...........6/27/2018 4:30:09 PM
SS_MM_Master_Germany_2018.txt ...........6/27/2018 4:30:09 PM
till SS_MM_Master format is same and countryname may change based on users...expecting any dynamic query which consider country name as different string check max(modified date) based on year...any small example help appreciated