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 SUBSCRIPTION NUMBERS, LICENSE 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.
User avatar
PGomersall
Posts: 92
Joined: Sun Mar 03, 2013 12:40 pm

Problem with script params

Post by PGomersall » Mon Nov 16, 2015 12:00 pm

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 104 times
paramerror.png
paramerror.png (74.69 KiB) Viewed 2748 times

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: Problem with script params

Post by davidc » Mon Nov 16, 2015 12:18 pm

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
Joined: Thu Aug 18, 2011 4:56 am

Re: Problem with script params

Post by davidc » Tue Nov 17, 2015 4:10 pm

Please try the latest service build v4.2.89.

David
David
SAPIEN Technologies, Inc.

User avatar
PGomersall
Posts: 92
Joined: Sun Mar 03, 2013 12:40 pm

Re: Problem with script params

Post by PGomersall » Tue Nov 17, 2015 5:27 pm

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
Joined: Thu Aug 18, 2011 4:56 am

Re: Problem with script params

Post by davidc » Wed Nov 18, 2015 10:04 am

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: 92
Joined: Sun Mar 03, 2013 12:40 pm

Re: Problem with script params

Post by PGomersall » Wed Nov 18, 2015 10:56 am

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 2704 times

User avatar
PGomersall
Posts: 92
Joined: Sun Mar 03, 2013 12:40 pm

Re: Problem with script params

Post by PGomersall » Wed Nov 18, 2015 1:38 pm

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: 92
Joined: Sun Mar 03, 2013 12:40 pm

Re: Problem with script params

Post by PGomersall » Mon Dec 14, 2015 11:19 am

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
Joined: Thu Aug 18, 2011 4:56 am

Re: Problem with script params

Post by davidc » Mon Dec 14, 2015 12:59 pm

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.