1 2 3 4 5 6 7 8 9 |
$files = Get-ChildItem -File -Recurse -Include *.c, *.h $files.foreach{ $count = ((Get-Content $_).foreach{if($_ -match "/[/\*]\!"){$matches}}).Count if ($count -gt 0) { Write-Host $count $_.Name } } |
1 2 3 4 5 6 7 8 9 |
$files = Get-ChildItem -File -Recurse -Include *.c, *.h $files.foreach{ $count = ((Get-Content $_).foreach{if($_ -match "/[/\*]\!"){$matches}}).Count if ($count -gt 0) { Write-Host $count $_.Name } } |