logoalt Hacker News

fainpullast Wednesday at 2:22 PM2 repliesview on HN

In PowerShell:

  gci -file | sort-object size | select name, size -first 4 | % { $_.size /= 1MB; $_ } | ConvertTo-Json

Replies

xigoilast Thursday at 9:26 AM

ConvertTo-Json? What kind of naming convention is that, especially with all the other commands being lowercase?

show 1 reply
NSPG911last Thursday at 6:29 AM

i dont think you need to select name and size, you can just remove it and use `select -first 4`, but cool, I never knew about `/=` syntax

show 1 reply