Tuesday, December 27, 2011

Frivolous PowerShell

PowerShell is great for Windows enterprise heavy lifting and automation.  It's also great for answering some of life's smaller, and perhaps more important, questions like "When will this 18 gigabyte download be done?".  Granted, most browsers and download managers have a time estimate easily available.  However, I found myself with a large download and no built in time estimate the other day.  I don't know about you, but I'm not very good at figuring out how many hours a multiple gigabyte download will take at 475Kb/sec in my head.  Turns out it's pretty simple in PowerShell:

PS>(get-date).addseconds(16.8GB/475KB)

Then again, when it told me that my download wouldn't finish until after midnight - I just went to bed!