When writing advanced functions in Powershell you have ton of optional things you can add to make your scripts more usable. One of those is using OutputType() . Admittedly, I’ve never used  OutputType()  in my scripts. I have no real excuse. I just blame my ignorance. At first I thought, why would I need to do this? The scripts work fine without it. That is until I came across Lee Holmes’ excellent blog post entitled What is OutputType()?. Not only does using  OutputType()  add tab-completion functionality to your object but the Powershell ISE also leverages this for Intellisense. Pretty cool!

Rather than rambling on about this obscure topic I’ll just leave you with another link to Bartek Bielawski’s blog post entitled OutputType – Why Would You Care?. Bartek does a great job in explaining in a little more in-depth as to why you’d want to use OutputType() .

%d bloggers like this: