Skip to content

Instantly share code, notes, and snippets.

@Kurt-P
Created August 20, 2013 20:54
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Kurt-P/6287165 to your computer and use it in GitHub Desktop.
Save Kurt-P/6287165 to your computer and use it in GitHub Desktop.
Group and sum a set of data with powershell
$gdata = $printsLogs | Group-Object -Property userId
$test = @()
$test += foreach($item in $gdata){
$item.Group | Select -Unique userId,
@{Name = 'PageTotal';Expression = {(($item.Group) | measure -Property pages -sum).Sum}}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment