I want to get today's files with the below file naming convention from the list of other files in the directory using powershell script. Need to match today's date and also the file name.
TransferAA_MGH_20211206070920_xlsx.XLSX
TransferBB_MGH_20211206071130_xlsx.XLSX
I tried below however it's not working.
Get-ChildItem -Path Testfolder\*.XLSX | Where-Object {$_.Name -match '(?:^|.*\D)(\d{8})(?:\D.*|$)' -and $Matches[1] -eq ((Get-Date).Date)
Thanks for the help.