Tips and Tricks

Tips and Tricks
Don Jones
PowerShell for Admins

Installing PowerShell v5? Be a Little Careful, OK?

I’m getting a lot of questions from folks, via Twitter and other venues, regarding Windows Management Framework 5.0 - which is where PowerShell v5 comes from. It’s awesome that people are installing v5 and kicking the tires - however, please help spread the word: v5 is a preview. It …

Steven Murawski
Tips and Tricks

Going Deeper on DSC Resources

Desired State Configuration is a very new technology and declarative configuration management is a very young space yet. We (Microsoft and the community) are still figuring out the best structure for resources, composite configurations, and other structures. That said, there are certain viewpoints …

Don Jones
PowerShell for Admins

Why Get-Content Ain't Yer Friend

Well, it isn’t your enemy, of course, but it’s definitely a tricky little beast. Get-Content is quickly becoming my nemesis, because it’s sucking a lot of PowerShell newcomers into its insidious little trap. Actually, the real problem is that most newcomers don’t really …

Don Jones
PowerShell for Admins

Regular Expressions are a -replace's best friend

Are you familiar with PowerShell’s -replace operator? "John Jones" -replace "Jones","Smith" Most folks are aware of it, and rely on it for straightforward string replacements like this one. But not very many people know that -replace also does some amazing stuff …

Don Jones
PowerShell for Admins

Why Doesn't My ValidateScript() work correctly?

I’ve received a few comments from folks after my observations on the Scripting Games Event 1. In those observations, I noted how much I loved: [ValidateScript({Test-Path $_})][string]$path As a way of testing to make sure your -Path parameter got a valid value, I love this. I’d never …

Don Jones
PowerShell for Admins

What are Your PowerShell Newbie Gotchas?

I’m putting together a list of common “gotchas” for PowerShell, mainly things that affect newcomers. So far, I’ve got: Piping the output of a Format cmdlet to nearly anything else Using -contains instead of -like Selecting a subset of object properties and then trying to …

Don Jones
Tips and Tricks

PowerShell.org Forums Etiquette

Folks often ask for some advice on what to do, and what not to do, in the forums. Here are some suggestions. Don’t apologize for being a “noob” or “newbie” or “n00b.” There’s just no need - nobody will think you’re stupid, and the forums are all …