(*** Please do not write "latest" as a version, specify a version number ***)
PowerShell Studio 2016 5.2.129
32 or 64 bit version of product: 64
Operating system: Windows 10
32 or 64 bit OS: 64
PowerShell Version: 5.1.14393.206
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
I am have been using the 'Edit Parameters' dialog box (which it great by the way) and am trying to create a parameter that works like 'Write-Host -ForegroundColor availablecolors'.
What I mean is when you use the -ForegroundColor switch and use the tap key or drop down (depending on environment) you have the available options of the different default colors.
I want to create a parameter that works just like that.
Is this possible using the 'Edit Parameters' wizard and if so what steps are involved to make this happen?
Thanks
Creating parameters with defult values
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Creating parameters with defult values
If I understand correctly, you're wanting to use the 'Edit Parameters' dialog to create a window similar to this?
For example, you can do this in the 'Edit Parameters' dialog like so:
If that's what you're trying to achieve, it depends entirely upon where you're wanting this information displayed. My recommendation to you is to use a ValidateSet() and give the parameter a limited set of colors that are available for use. For example, you can do this in the 'Edit Parameters' dialog like so:
- First, you're going to want to add the parameter how you want it, then select edit:
- In the resulting dialog, in the Validation panel click Add -> Validate Set:
DevinL
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Creating parameters with defult values
No problem, I'm glad that's what you needed.
If you have any further issues, please don't hesitate to post again.
If you have any further issues, please don't hesitate to post again.
DevinL
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: Creating parameters with defult values
If you use the System.Drawing.Color type, PowerShell Studio will automatically list the available colors.
This way you don't have to create a ValidationSet.
- [System.Drawing.Color]$color
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.