Calling Extension Methods in PowerShell

A quick one because it’s Friday night. I recently found myself translating some C# code into PowerShell.  If you’ve done this, you know that most of it is really routine.  Change the order of some things, change the operators, drop the semicolons. In a few places you have to do some adjusting, like changing using …

Continue reading ‘Calling Extension Methods in PowerShell’ »

Deciphering PowerShell Syntax Help Expressions

In my last post I showed several instances of the syntax help that you get when you use get-help or -? with a cmdlet. For instance: This help is showing how the different parameters can be used when calling the cmdlet. If you’ve never paid any attention to these, the notation can be difficult to work …

Continue reading ‘Deciphering PowerShell Syntax Help Expressions’ »

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

You don’t need semicolons in multi-line hashtable literals.

This is not a world-changing topic, but I thought it was worth sharing. If you have written hashtable literals on a single line, you’ve seen this before: Sometimes, it makes more sense to write the hashtable over several lines, especially if it has several items. I’ve always written them like this: I was watching Don …

Continue reading ‘You don’t need semicolons in multi-line hashtable literals.’ »