Edit Parameters doesn't work on existing parameter block

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
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.
This topic is 3 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
pdearmen
Posts: 66
Last visit: Tue Apr 02, 2024 2:21 pm

Edit Parameters doesn't work on existing parameter block

Post by pdearmen »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: Powershell Studio 2020 Version 5.7.178
32 or 64 bit version of product: 64 bit
Operating system: Windows 10 (latest version with all windows updates)
32 or 64 bit OS: 64 bit

*** Please add details and screenshots as needed below. ***

While working on a new script I noticed an odd behavior after I updated to PowerShell Studio Version 5.7.178

I used the edit parameters dialog to setup the initial parameters for a new script. After going through the initial version of script writing, I clicked on Edit Parameters and noticed that all of the parameters were empty. The comment based help that I had entered in was populated but the rest was not.
ScreenShot1ParameterBuilder.PNG
ScreenShot1ParameterBuilder.PNG (50.95 KiB) Viewed 1026 times
However, If I add function around the parameter set the edit function dialog will work as intended and populates.
So I went from:
[CmdletBinding(DefaultParameterSetName = 'Default',
ConfirmImpact = 'None',
SupportsShouldProcess = $false)]
[OutputType([int], ParameterSetName = 'Default')]
[OutputType([psobject], ParameterSetName = 'IncludeCertName')]
param
( .. )

To:
function test{
[CmdletBinding(DefaultParameterSetName = 'Default',
ConfirmImpact = 'None',
SupportsShouldProcess = $false)]
[OutputType([int], ParameterSetName = 'Default')]
[OutputType([psobject], ParameterSetName = 'IncludeCertName')]
param
( .. )
}
ScreenShot2EditFunction.PNG
ScreenShot2EditFunction.PNG (58.68 KiB) Viewed 1026 times
I copied the parameter block to a new file and was able to reproduce the same issue.

I included the blocks in one file since the attachment upload limit is 3.

This isn't a critical issue since I can do a workaround by temporarily making the parameter block a function or doing the modification manually

Thanks!

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
Attachments
CodeBlocks.txt
(3.81 KiB) Downloaded 113 times
User avatar
Olga_B
Site Admin
Posts: 196
Last visit: Tue Apr 16, 2024 11:06 am

Re: Edit Parameters doesn't work on existing parameter block

Post by Olga_B »

Thanks for reporting the issue.
The it has been sent to the proper place for evaluation and correction. When a fix is issued with a service build, it will be listed in the change log.
This topic is 3 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.