My Solution to Iron Scripter 2019 Preparatory Challenge 1

Anyone who has competed in the scripting games before knows that I’m always looking for a challenge when it comes to writing PowerShell code. While the scripting games haven’t been held in the last several years, they’ve somewhat been replaced by the Iron Scripter competition at the PowerShell + DevOps Global Summit and 2019 is shaping up to be no different. Think you’ve got skills? Bring them on! and Get-Involved....

February 16, 2019 · 5 min · 902 words · Mike F. Robbins

The PowerShell Iron Scripter: My solution to prequel puzzle 3

I’ve been working through the Iron Scripter 2018 prequel puzzles which can be found on PowerShell.org’s website. In puzzle 3, you’re asked to create a “reusable PowerShell artifact”. To me, that almost always means a PowerShell function. One requirement is to pull information from the PowerShell.org RSS feed. Invoke-RestMethod which was introduced in PowerShell version 3.0 is the easiest way to accomplish that task. You’re also asked to display the returned information in a way that allows the user to select an item from the feed....

February 3, 2018 · 4 min · 816 words · Mike F. Robbins

Announcing the Winner of the PowerShell TFM Book Contest

Two weeks ago, I started a PowerShell contest which required the participants to convert a string of text to title case. I didn’t specifically say title case but I explained that the first letter of each word should be converted to upper case and all remaining letters in each word should be converted to lower case. This was because a search on how to convert to title case with PowerShell gave away a good portion of the answer....

October 8, 2015 · 4 min · 693 words · Mike F. Robbins

Windows PowerShell TFM Book Contest and Giveaway

Today is the first day of Autumn also known as fall here in North America and it’s my favorite time of the year. If nothing else, you’ve got to love the cooler weather and the changing of tree leaf colors. Last fall, a new version of the Windows PowerShell TFM book that I co-authored along with Jason Helmick was published and strangely enough, its design is remarkably similar to the colors that are associated with Autumn....

September 23, 2015 · 3 min · 519 words · Mike F. Robbins

My Solution: August 2015 PowerShell Scripting Games Puzzle

A couple of months ago, PowerShell.org announced that the PowerShell Scripting Games had been re-imagined as a monthly puzzle. In August, the second puzzle was published. The instructions stated that a one-liner could be used if you were using a newer version of PowerShell. A public JSON endpoint can be found at https://www.telize.com/geoip and your goal is to write some PowerShell code to display output similar to the following: longitude latitude continent_code timezone --------- -------- -------------- -------- -115....

August 30, 2015 · 7 min · 1284 words · Mike F. Robbins

My Solution: July 2015 PowerShell Scripting Games Puzzle

Last month, PowerShell.org announced that the PowerShell Scripting Games had been re-imagined as a monthly puzzle and the first puzzle was published. The instructions stated to use a PowerShell one-liner that produces the following output. No more than one semicolon should be used, do not use the ForEach-Object cmdlet or one of its aliases. The one-liner should be able to target more than one computer and feel free to go crazy with a really short one-liner with aliases and whatever else....

August 6, 2015 · 3 min · 588 words · Mike F. Robbins

PowerShell Tip from the Head Coach of the 2014 Winter Scripting Games: Design for Performance and Efficiency!

There are several concepts that come to mind when discussing the topic of designing your PowerShell commands for performance and efficiency, but in my opinion one of the items at the top of the list is “Filtering Left” which is what I’ll be covering in this blog article. First, let’s start out by taking a look at an example of a simple one-liner command that’s poorly written from a performance and efficiency standpoint:...

January 23, 2014 · 3 min · 570 words · Mike F. Robbins

PowerShell Tip #3 from the Winner of the Advanced Category in the 2013 Scripting Games

In my previous blog article, I left off with the subject of inline help and stated there was a better way. I’m fast-forwarding through lots of concepts and jumping right into “Advanced Functions and Scripts” with this tip because they are where you’ll find the answer to a “better way” to add inline help. The inline comments we saw in the previous tip looked like this: function Get-BiosInfo { # Attempting to retrieve the BIOS information from the local computer Get-WmiObject -Class Win32_BIOS } When looking at the syntax for this function, you can see that it has no parameters:...

January 16, 2014 · 3 min · 548 words · Mike F. Robbins

PowerShell Tip #2 from the Winner of the Advanced Category in the 2013 Scripting Games

Tip #2 - Comment (Document) your code! This is another one of those tips that probably isn’t very popular, but regardless of how good you are at writing PowerShell scripts and functions, they’re useless if no one else can figure out how to use them. You might be thinking that you’re the only one who uses the PowerShell code that you write, but I’m sure that you like to go on vacation just like the rest of us and none of us are going to live forever....

January 9, 2014 · 3 min · 582 words · Mike F. Robbins

PowerShell Tip #1 from the Winner of the Advanced Category in the 2013 Scripting Games

In case you haven’t heard, the 2014 Winter Scripting Games are just now getting started. Regardless of your skill level with PowerShell, it couldn’t be a better time to participate since this is the first time in the history of the scripting games that you’ll be able to work as part of a team and receive proactive feedback (before your code is judged) from a team of expert coaches who use PowerShell in the real world on a daily basis....

January 3, 2014 · 3 min · 452 words · Mike F. Robbins

How to Create PowerShell Script Modules and Module Manifests

My entry for the Scripting Games advanced event 4 contained four separate functions: I want to create a module that contains these functions. There are several different types of modules, but what I’ll be creating is a “Script Module”. Modules sound like something really complicated, but script modules are actually simple. Currently, I have the functions saved as a ps1 file which I dot-source to load the functions into memory, but I want to share this tool with others so it makes more sense to create a module out of it....

July 4, 2013 · 3 min · 565 words · Mike F. Robbins

Using a Counter Variable in a PowerShell Workflow Foreach -Parallel Loop

As I’m sure most of my blog readers are aware, I competed in the advanced track of the Scripting Games this year and ended up doing quite well. Two first place finishes and three second places finishes with the official judges and four first place crowd score finishes. I also ended up being the overall winner of the advanced track. A few days ago someone on twitter asked me as the winner of the Scripting Games advanced track, what I would do with it?...

June 20, 2013 · 2 min · 353 words · Mike F. Robbins