ConfigMgr Run Scripts -> Add List for Parameters

I’ve recently posted several Run Scripts which leverage parameters, in which I say to use a List option for the Parameters. I noticed the Docs page doesn’t really go over this well, so I’m going to write up a quick post.

MS Docs – Run Scripts Parameters

When Creating a Run Script, and using a Script that has Parameters, after you paste in the script, the next page will show the varaiables.

In this example, I’ll be using my Run-HPIA script: Run-HPIA.ps1

This script has several parameters that I want to make into a list of options to choose. After pasting in the script, and hit Next, I see this page:

At this point, I click on each Parameter, and click Edit:

I then change the Data Type from String to List

Change String to List

I then add in all of the options I want available to pass into the Parameter:

Now when you run the script, you’ll have all of the options available in the drop downs for the Parameters:

Using the List option is a great way to ensure people don’t mistype, or put something into the parameter you don’t want them to, and makes it quick and easy to run the script in different ways.


1 thought on “ConfigMgr Run Scripts -> Add List for Parameters”

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.