How do you specify that a parameter accepts wildcard characters in a custom script cmdlet


When you do Get-Help SomeCommand -Full, under each parameter, after the description, there are some additional parameter properties. One of those properties is ‘Accept Wildcard Characters?’. When I create my help information for a custom script cmdlet how do I specify that a parameter accepts wildcards?


If you want to be able to do this it will require a few things. First off, you either have to create a .dll file, which you are not doing, or you have to create a module. I am not going to go into all of the ins and outs of creating a module, there are already many well written guides on how to do that out there on the internet that you can go look up.

As a part of your module you can include .XML files that provide Help information similarly to the commented help available for individual scripts. The XML style does have some advantages, such as consistency and some advanced features, but does require more effort. Towards this end I would strongly suggest reading Writing Help for Windows PowerShell Modules, as it will explain where to place your XML files, how to structure them, and required headers and what not.

If it were me I’d probably copy an existing XML help file and edit it to suit my needs for the cmdlet, find and read one of the quick-and-dirty HowTo’s about creating a module, and then give up on the idea since it’s not worth the effort involved to just add that ‘Supports Wildcards’ flag (in my opinion) if this all started out just as a basic script with commented help.

But the answer is, create a module and supporting XML based Help file for your cmdlet. With that you can add support for the Accepts Wildcards flag for your parameters.


How do you specify that a parameter accepts wildcard characters in a custom script cmdlet by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply