Problem with script params

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 8 years and 4 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
PGomersall
Posts: 138
Last visit: Thu Apr 11, 2024 7:51 am

Problem with script params

Post by PGomersall »

Product, version and build: PowerShell Studio 2015 4.2.9.7
32 or 64 bit version of product: x64
Operating system: WS16TP3
32 or 64 bit OS: x64
PSS15 does not correctly recognize a parameter block. It does not recognize the last param. See attached image and script.
Even trying to do the same with your param builder doesn't work. Attached file work correctly in ISE.
Regards,
Pete
Attachments
Get-BcdStore.ps1
(1.79 KiB) Downloaded 178 times
paramerror.png
paramerror.png (74.69 KiB) Viewed 4086 times
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Problem with script params

Post by davidc »

Thank you for reporting this.

It seems the parser was not parsing the hexadecimal number correctly. The issue will be resolved in the next service release.

David
David
SAPIEN Technologies, Inc.
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Problem with script params

Post by davidc »

Please try the latest service build v4.2.89.

David
David
SAPIEN Technologies, Inc.
User avatar
PGomersall
Posts: 138
Last visit: Thu Apr 11, 2024 7:51 am

Re: Problem with script params

Post by PGomersall »

David,
I believe there is still something wrong or I am using the parameter dialog on run wrongly. Can you test the script I originally attached. All it does is enumerate boot entries in the BCD store. It requires elevation. However, when run from PSS it pulls up the parameter dialog, but it doesn't include the set default entries in the param block. Clicking OK and the script errors out so it is not processing the defaults.
Pete
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Problem with script params

Post by davidc »

The default values aren't inserted into the parameter dialog, but are still used by PowerShell if the parameter isn't defined.

I will add a feature request to include the default value when displaying the parameter dialog.

David
David
SAPIEN Technologies, Inc.
User avatar
PGomersall
Posts: 138
Last visit: Thu Apr 11, 2024 7:51 am

Re: Problem with script params

Post by PGomersall »

So running my originally attached script from with PSS it will not complete without error. When I run the script it throws up the parameter dialog as attached. I have not found a way to get past this dialog and run this script in PSS; it calls the UAC prompt and then just produces error. In ISE it works flawlessly, not prompting for a value. How can I run script is PSS without it raising the parameter dialog?
Pete
Attachments
param-dialog.png
param-dialog.png (4.96 KiB) Viewed 4042 times
User avatar
PGomersall
Posts: 138
Last visit: Thu Apr 11, 2024 7:51 am

Re: Problem with script params

Post by PGomersall »

David, I found my own answer > disable the popup in the editor options.
Going back to the popup and you mentioning adding a feature request; may be it could show\load the defaults that are set in the script when it opens and there be a button to "Use Defaults"?
I think we can consider this item closed.
Regards,
Pete
User avatar
PGomersall
Posts: 138
Last visit: Thu Apr 11, 2024 7:51 am

Re: Problem with script params

Post by PGomersall »

David,
So I thought I had this fixed. However running 4.2.99 on a script with a parameter block I cannot prevent the parameter popup from appearing when I run the script.
Where is the option to turn this on and off? I thought it was in Options > Editor Settings. In the dialog there doesn't seem to be anything related to disabling this popup now.
Pete
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Problem with script params

Post by davidc »

There is no specific option; the dialog appears when there is a parameter block present.

I will add a feature request to allow a bypass.

David
David
SAPIEN Technologies, Inc.
This topic is 8 years and 4 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.