Page 1 of 1

Edit Parameters doesn't work on existing parameter block

Posted: Thu May 28, 2020 8:56 am
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 436 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 436 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

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

Posted: Thu May 28, 2020 1:50 pm
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.