Re-Thinking Positional Parameters

I mentioned in a previous post that I’ve recently changed my mind a bit about the Position parameter attribute. I guess technically it is the position parameter of the Parameter parameter attribute (i.e. there’s a parameter attribute called “Parameter” and it has a parameter called position). I don’t think you could come up with something …

Continue reading ‘Re-Thinking Positional Parameters’ »

PowerShell Code Review Guidelines

I get asked to look at other people’s PowerShell code a lot at work, and I really enjoy it.  I also find myself looking at my “old” code from several years ago (back to 2007!) and think…there’s a lot of work to be done. To that end, I’ve compiled a list of “PowerShell code review …

Continue reading ‘PowerShell Code Review Guidelines’ »

PowerShell Code Smells: Boolean Parameters

This is a real quick one. In PowerShell, the “native” way to express a two-state variable is with Switch parameters. For instance: When calling Test-Thing, you can either supply -Recurse or leave it off. It’s a flag. This is PowerShell 101. Programmers coming from other languages are used to Boolean variables. Sometimes, one slips through …

Continue reading ‘PowerShell Code Smells: Boolean Parameters’ »