Generating All Case Combinations in PowerShell

At work, a software package that I’m dealing with requires that lists of file extensions for whitelisting or blacklisting be case-sensitive. I’m not sure why this is the case (no pun intended), but it is not the only piece of software that I’ve used with this issue. What that means is that if you want …

Continue reading ‘Generating All Case Combinations in PowerShell’ »

Hyper-V HomeLab Intro

So  I’ve been playing with Hyper-V for a while now.  If you recall it was one of my 2016 goals to build a virtualization lab. I’ve done that, building out the base Microsoft Test Lab Guide several times: Manually (clicking in the GUI) Using PowerShell commands (contained in the guides) Using Lability and PS-AutoLab-Env I was also …

Continue reading ‘Hyper-V HomeLab Intro’ »

PowerShell Parameter Disambiguation and a Surprise

When you’re learning PowerShell one of the first things you will notice is that you don’t have to use the full parameter name.  This is because of something called parameter disambiguation. When it works For instance, instead of saying Get-ChildItem -Recurse, you can say Get-ChildItem -R.  Get-ChildItem only has one (non-dynamic) parameter that started with the …

Continue reading ‘PowerShell Parameter Disambiguation and a Surprise’ »

When the PowerShell pipeline doesn’t line up

The PowerShell Pipeline One of the defining features of PowerShell is the object-oriented pipeline.  The ability to “wire-up” parameters to the pipeline and allow objects (or properties) to be automatically assigned to them allows us to write code that is often variable-free. By “variable-free”, I mean that instead of doing something like this: we can …

Continue reading ‘When the PowerShell pipeline doesn’t line up’ »

Great Books for PowerShell Ideas

I get asked a lot about what PowerShell books people should be reading. The easy answer is, “It depends”. If you’re looking for a tutorial book (or two) to get you started with PowerShell, the only answer I give is “Learn PowerShell in a Month of Lunches”, followed by “Learn PowerShell Toolmaking in a Month …

Continue reading ‘Great Books for PowerShell Ideas’ »

Some small PowerShell bugs I’ve found lately

I love PowerShell. Everyone who knows me knows that. Recently, though, I seem to be running into more bugs. I’m not complaining, because PowerShell does tons of amazing things and the problems I’m encountering don’t have a huge impact. With that said, here they are. Pathological properties in Out-GridView PowerShell has always allowed us to …

Continue reading ‘Some small PowerShell bugs I’ve found lately’ »

Module Structure Preferences (and my module history)

Modules in the Olden Days Back in PowerShell 1.0 days, there were no modules.  Uphill both ways.  In 1.0, we only had script files.  That means you had a couple of choices when it came to deploying functions.  Either you put a bunch of functions in a .ps1 file and dot-sourced it, or you used …

Continue reading ‘Module Structure Preferences (and my module history)’ »

VisioBot3000 Settings Import

It’s been a while since I last spoke about VisioBot3000.  I’ve got the project to a reasonably stable point…not quite feature complete but I don’t see a lot of big changes. One of the things I found even as I wrote sample diagram scripts was that quite a bit of the script was taken up …

Continue reading ‘VisioBot3000 Settings Import’ »

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’ »