Doing more with functions: Verbose logging, Risk mitigation, and Parameter Sets

Welcome back to PowerShell for Programmers, this week I’m trying gitGist again for the code blocks. Let me know what you think about it vs the normal syntax highlighter I use 🙂 As we’ve seen in the other posts about functions, attributes are a really cool thing to extend the features we have available to…

2

Doing More With Functions: Comment-Based Help

I just wanted to throw together a post highlighting how cool and easy it is to add help data to your own Functions and scripts. The help data gets added via comments. For functions the help data can go in three places: Before the function keyword (I like it up here) Between the open curly…


Doing More With Functions: Taking Parameters on the Pipe

In an earlier post, I showed you how you could use the [parameter(mandatory)] attribute to force your parameters to behave  a bit more like you’d expect from other languages. We also have a bunch of other useful attributes we can use on our parameters to enable cool features. Pipelineing The pipe might feel pretty magical…