Scripting Blog

A place to learn about PowerShell and share stories of automation

Create a Hash Table in PowerShell that Contains Hash Tables

Summary: Learn how to work with hash tables that contain other hash tables in Windows PowerShell. Microsoft Scripting Guy, Ed Wilson, is here. Well, it is a typical winter day here in Charlotte, North Carolina in the United States. I am not talking about a nice, cool, sunny day with cobalt blue skies streaked by fluffy cotton candy clouds&...

Easily Create and Manipulate an Array of Arrays in PowerShell

Summary: Learn about creating an array of arrays in Windows PowerShell, and see how to store numerical data and rich objects in elements. Microsoft Scripting Guy, Ed Wilson, is here. Yesterday in Charlotte, North Carolina in the United States, it was 60 degrees Fahrenheit (that is 15 degrees Celsius according to my unit conversion module). I ...

Read a CSV File and Build Distinguished Names on the Fly by Using PowerShell

Summary: Learn two ways to read a CSV file with Windows PowerShell and build distinguished names on the fly. Hey, Scripting Guy! I am working on my first big project with Windows PowerShell, and I have been unable to locate a good answer on the Internet. I am having trouble figuring out how to connect a bunch of different array items. Here is...

Format Multilevel Arrays in PowerShell

Summary: Microsoft Scripting Guy Ed Wilson talks about formatting multilevel arrays in Windows PowerShell.   Hey, Scripting Guy! I am having a problem with arrays. I have two-level arrays and they work perfectly when I have the arrays defined on a single line. But when I try to format my script so that it is easier to read, they seem to ...

Use PowerShell to Pick Random Winning Users from Text

Summary: Learn how to use Windows PowerShell to select random winners from a text file.   Hey, Scripting Guy! I have a question. It is neither a vital server performance issue nor is it a dramatic process optimization revelation, but it is something that will make my life a lot easier. First the background: I have been going to our local ...

Feedback usabilla icon