Skip to content

Instantly share code, notes, and snippets.

@Curtmcgirt
Last active September 28, 2019 02:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Curtmcgirt/d44d5bec35a71f45214c30c14b80e3d3 to your computer and use it in GitHub Desktop.
Save Curtmcgirt/d44d5bec35a71f45214c30c14b80e3d3 to your computer and use it in GitHub Desktop.
v4.v5
#v4
Measure-Command { foreach($source in $sources)
{
$sourcepath = $source.path.replace('\','/')
$count = $allstats.sourcefilename.Where({$_ -like "*$sourcepath*"}).count
$array += [pscustomobject]@{count = $count; path = $source.path}
}
}
#v5
Measure-Command {
    foreach ($source in $sources)
    {
$sourcepath = $source.path.replace('\','/')
        $array += [pscustomobject]@{
        count = $allstats.sourcefilename.Where({$_ -like "*$sourcepath*"}).count
        path = $source.path}
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment