“To ship is the choose.” That is the sad reality behind a number of the things that we regretted about V1. When we first started the project (a LONG time ago) we knew that we wanted to close the semantic gap between what admins thought and what they had to type. Imagine that you wanted to find all the processes that had greater than 15MB of workingset. Who the heck could type in the following:
PS> Get-Process |where {$_.Workingset –ge ?????}
What? You didn’t know that 15MB was 15728640 bytes? Yes you should have written:
PS> Get-Process |where {$_.Workingset –ge 1572850}
Wait – is that right?
NO! As I typed it in, I made a mistake. I thought I would leave it in to make the point. If you came across this line in a script would you have caught the mistake? I doubt it. Ok Ok – so you’re a genius – I asked the question wrong. Would the person in the next office have caught the mistake? Right - “no way!”
That is why we added shortcuts KB, MB, and GB
PS> 1kb 1024 PS> 1mb 1048576 PS> 1gb 1073741824 PS> 15mb 15728640 PS> 1kb+2mb+3gb 3223323648
This then allows you to type things like:
PS> Get-Process |where {$_.Workingset –ge 15mb}
Sadly we did this so early on that we thought GB was going to be enough. It wasn’t that long before we realized our mistake in not including TB and PB but at that point, we were up to our necks in feature prioritization and this never became higher priority than something else.
With V2, we decided to remedy this situation and we now support TB and PB.
PS> 1tb 1099511627776 PS> 1pb 1125899906842624 PS> 1kb+2mb+3gb+4tb+5pb 5633900804047872
(Want to double check our math? :-) )
To me, the interesting part of this story is the way we got this into V2. The fact of the matter is that if we had done feature prioritization, I doubt very much that we would have included this change. What happened was that a number of us were embarrassed by this mistake and just decided to do the right thing and fix it. In retrospect, I think it was exactly the right thing to do. The lesson here is that you have processes and you have judgment and that success is all about finding the right balance between these two.
Experiment! Enjoy! Engage!
Jeffrey Snover [MSFT] Distinguished Engineer Visit the Windows PowerShell Team blog at: http://blogs.msdn.com/PowerShell Visit the Windows PowerShell ScriptCenter at: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx