Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
$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

This comment has been minimized.

Copy link
Owner Author

@camusicjunkie camusicjunkie commented Jul 21, 2019

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

@thedavecarroll

This comment has been minimized.

Copy link

@thedavecarroll thedavecarroll commented Oct 10, 2019

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

This comment has been minimized.

Copy link
Owner Author

@camusicjunkie camusicjunkie commented Oct 10, 2019

Absolutely. Go for it! 👍

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