Hello there,
Found this script online and might be useful for you,
Install-Module PSExcel
Import-Module PSExcel
$cardRegex = "(^4[0-9]{12}(?:[0-9]{3})?$)|(^(?:5[1-5][0-9]{2}|222[1-9]|22[3-9][0-9]|2[3-6][0-9]{2}|27[01][0-9]|2720)[0-9]{12}$)|(3[47][0-9]{13})|(^3(?:0[0-5]|[68][0-9])[0-9]{11}$)|(^6(?:011|5[0-9]{2})[0-9]{12}$)|(^(?:2131|1800|35\d{3})\d{11}$)"
Get-ChildItem -Recurse -File "*.xlsx" | ForEach-Object {Search-CellValue -Path $.FullName -FilterScript {if($ -match "-"){$.replace("-","") -match $cardRegex}else{$ -match $cardRegex}}}
I hope this information helps. If you have any questions please let me know and I will be glad to help you out.
-----------------------------------------------------------------------------------------------------------------------------------------
--If the reply is helpful, please Upvote and Accept it as an answer--