janbaer
6/20/2013 - 9:46 AM

Find a specific content of a file with a regular expression in powershell

Find a specific content of a file with a regular expression in powershell

cls

$path = 'd:\Git\sp'
$file = '*.csproj'
$regex = "^.*(?=Output).*\.dll</HintPath>"
Get-ChildItem -Path $path -Name $file -Recurse | where {(get-Content $_ | Select-String $regex)}