Write-Host Considered Harmful

[2023 Update]  

I’ve been meaning to update this for a while.  The advice in this post is no longer current.  A while ago we changed the implementation of Write-Host to being a wrapper on top of Write-Information.  Prior to this, when you used Write-Host, there was no way to capture and process the data you wrote – because it just wrote to the host.  Now that it uses Write-Information, it goes through a path that writes to the host AND allows you to capture and process that information.
-Jeffrey Snover

[End 2023 Update]

When you are writing or reviewing PowerShell scripts, I’d like you to remember the following rule of thumb:

Continue reading

Evolution of a Script: Timing Operations

I just love PowerShell!  One of the things I love the most about it is that you can pick the level of programming you want, write a script and then evolve it to meet whatever need you have.  Sometimes you want something quick and dirty and other times you want something you’ll share with others and then other times you want something that is going to be used in production. Continue reading

Days Till Xmas

This morning my daughter asked my wife how many days there were until Christmas. That conversation didn’t go so well.  🙂   Seriously though, this year things started super early.  The local store started selling Christmas stuff before Halloween and a couple of weeks ago our neighbors put up their Christmas lights.  I can understand why my daughter is getting whipped up into an Christmas frenzy.  That said, as my wife contemplates a big day of effort for Thanksgiving, I can understand why questions about Christmas are not welcome. Continue reading

Monad Manifesto

I wrote the  Monad Manifesto in 2002.  I had been working on Monad for over a year at that point and had been relying upon whiteboard conversations and demos in my office to bring people up to speed on what we were doing.  That model didn’t scale well and different people need different forms of information in order to get it.  In particular, we were originally trying to do PowerShell as a distribute development model where we had a few PMs, a Dev Lead (Bruce Payette) and myself working in Redmond and then the development and test teams working at the India Development Center in Hyderabad India.  Continue reading