Skip to content

Instantly share code, notes, and snippets.

@camusicjunkie
Created July 21, 2019 16:44
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 camusicjunkie/7d7f25c1f3ebbae966493b866267dd34 to your computer and use it in GitHub Desktop.
Save camusicjunkie/7d7f25c1f3ebbae966493b866267dd34 to your computer and use it in GitHub Desktop.
$files = gci -Recurse -File
$files | measure -Property length -Sum -Average | select @{n = 'ComputerName'; e = {$env:COMPUTERNAME}}, Count, Sum, Average, @{n = 'Date'; e = {Get-Date}}
@camusicjunkie
Copy link
Author

I always forget about Measure-Object. I rarely find myself using it.

@thedavecarroll
Copy link

Hey there.

I was going through the previous Iron Scripter challenges and thought that I could write some blog posts with walk-throughs for them.

My solution for this challenge used measure, but not as efficient as your solution. I was wondering if I could use your solution as the primary example (with attribution, of course) for the post.

Thanks!
Dave

@camusicjunkie
Copy link
Author

Absolutely. Go for it! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment