Last active
September 24, 2019 00:23
-
-
Save Curtmcgirt/2af417b7eb6301a0c6b6ef323f0709d1 to your computer and use it in GitHub Desktop.
posh v2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#v2 | |
Measure-Command {foreach($source in $sources) | |
{ | |
$count = 0 | |
foreach($allstat in $allstats) | |
{ | |
$sourcepath = $source.path.replace('\','/') | |
if($allstat.sourcefilename -like "*$sourcepath*") | |
{ | |
$count++ | |
} | |
} | |
$array += [pscustomobject]@{count = $count; path = $source.path} | |
}} | |
#v3 | |
measure-command {foreach($source in $sources) | |
{ | |
$sourcepath = $source.path.replace('\','/') | |
$count = ($allstats | ? sourcefilename -like "*$sourcepath*").count | |
$array += [pscustomobject]@{count = $count; path = $source.path} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment