Scripting Blog [archived]

Formerly known as the "Hey, Scripting Guy!" blog

PowerShell PowerTip: What is the point of Out-Variable?

A lot of times people see others using the common parameter -OutVariable instead of the best practice $var = <value>. This leads to a lot of folks wondering why OutVariable  exists. The real use for OutVariable is to save your data off, while still letting it get sent along the output stream. What this means is that you could use it...

Regular Expressions (REGEX): Introduction

Hi all, this week I'll be talking about Regular Expressions. I've got a few posts planned to get you set up and going with some basic Regex. Regex is used for extracting and validating data. Essentially, you can think of Regex as windows wild cards on steroids. Anytime we need to match data with a little more clarity than the *s and ?s ...

PowerShell For Programmers: Here Strings, There Strings, Everywhere Some String Strings

There won't be much code in today's post, but this can be a useful feature to know about. In addition to the expandable and literal strings we talked about, we can also use something called a Here String. Here strings allow us to have quote characters inside of our string that match the quote characters we use to create that string. For ...