Joel Bennett

Results 399 comments of Joel Bennett

One specific use case for PSTypeNames is when you're *adding* things to existing objects. For example, I was working last night on a function which has two parameter sets. One...

P.S. @vexx32 the *only* correct way to define classes and have them exported _correctly_ (in such a way that they live in your module and are scoped correctly) is to...

Yep, I should modify my recommendation, because I mispoke earlier. Clearly complex types aren't the best practice ... 1. The **best** practice for parameters is to use simple value types...

Yeah, if it's not just a boolean True/False, you'd want an enum. If we don't have a best practices about switches, I suppose it wouldn't hurt to add. We ought...

As an additional point, we've had some problems with functions that behaved differently than expected when people tried to pass through a switch statement: ```PowerShell function Test-One { [CmdletBinding()] param(...

To be clear. The guidance here is simple: # Do not treat SwitchParameter as a trinary As implied by the design, and documented [in the official about_ docs](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_functions_advanced_parameters?view=powershell-7.1#switch-parameter-design-considerations)

Have you tried [this view](https://poshcode.gitbooks.io/powershell-practice-and-style/) or [downloading](https://legacy.gitbook.com/book/poshcode/powershell-practice-and-style/details) the PDF or eBook versions? We should clearly update the main ReadMe.md on GitHub with those links to make them easier to find....

There's a difference between documenting what an attribute does and how it works, and writing best practice suggestions for their use. I'm trying to draw a line between them and...

Oh yeah, I know it's just because I indent it to make it happen. 😉 I mean, I've been adjusting how I write code to take advantage of features in...

It also needs to handle `-AsCustomObject` like what Pester uses: ![image](https://user-images.githubusercontent.com/192942/32426187-7e86c436-c286-11e7-8f2a-2bc9f85a9757.png)