I want to extract IPv4 and IPv6 pattern wherever used in the bunch of files/codes. I am using the below script but that fetches me only IPv4.
$regex ="\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b"
cd "D:\"
$excluded = @("*.pdf", "*.jpg", "*.jpeg", "*.dll", "*.exe", "*.gif", "*.png", "*.css", "*.vbproj", "*.vspscc", "*.rpt", "*.pdb", "*.zip", "*.rar", "*.flv", "*.cache", "*.dat", "*.bin", "*.sln", "*.wmv", "*.mpg", "*.mpeg", "*.tif", "*.ppt", "*.pptx" ,"*.pps", "*.pub", "*.swf", "*.msi")
Get-ChildItem -Recurse -exclude $excluded |
Select-String -Pattern $regex | Select-Object path,line,linenumber,filename | Export-Csv -Path "D:\result.csv" -notypeHow can I fetch all the possible patterns of IPv6 addresses along with IPv4, recursively. I am using Powershell 2.0