Extra quote characters in parameter settings

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 8 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
ggreen
Posts: 8
Last visit: Mon Apr 25, 2022 9:02 am

Extra quote characters in parameter settings

Post by ggreen »

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 5.7.175
32 or 64 bit version of product: 64
Operating system: Windows 10 1903
32 or 64 bit OS: 64

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

DO NOT POST LICENSES, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM

I am working on a PS Module project and for one of my functions, I am utilizing the 'ValidatePattern' parameter validation. I selected the provided 'Internet e-mail address' regex pattern from within the function builder tool. When it is put in place it looks like the snippet below and seems to work just fine.

Code: Select all

[ValidatePattern('\w+([-+.'']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*')]
Whenever I subsequently use the function builder tool to modify something about that particular function (not necessarily that specific parameter) extra single quote characters get added to the 'ValidatePattern' regex values. The snippet below shows what the 'ValidatePattern' line looks like after using the function builder to edit the function one time after the 'ValidatePattern' value is reset to the expected value above.

Code: Select all

[ValidatePattern('\w+([-+.'''']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*')]
I have also observed similar behavior when single quotes are used in the help message attribute for parameters but have simply avoided using them for the parameter help message attribute.

Is there a formatting setting I should have configured a certain way or something else I should be doing that will prevent this behavior from occurring going forward?

Thanks,
Glen
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 11:13 am
Answers: 39
Been upvoted: 30 times

Re: Extra quote characters in parameter settings

Post by brittneyr »

We will look into this and get back to you soon!
Brittney
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 11:13 am
Answers: 39
Been upvoted: 30 times

Re: Extra quote characters in parameter settings

Post by brittneyr »

I've been able to reproduce this and have filed a bug report for the development team.
Brittney
SAPIEN Technologies, Inc.
User avatar
ggreen
Posts: 8
Last visit: Mon Apr 25, 2022 9:02 am

Re: Extra quote characters in parameter settings

Post by ggreen »

Fantastic. Thank you for the update. It's greatly appreciated!
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 11:13 am
Answers: 39
Been upvoted: 30 times

Re: Extra quote characters in parameter settings

Post by brittneyr »

Please try build 5.7.179 and let me know of this is still an issue for you. :)
Brittney
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 11:13 am
Answers: 39
Been upvoted: 30 times

Re: Extra quote characters in parameter settings

Post by brittneyr »

My apologies for not getting back to you sooner. I was working on other projects and did not see any notifications from the forum that you had replied. I am currently running version 5.7.179 as requested and I do not see extra quotes getting added for the 'ValidatePattern' parameter option, but do still see them getting added for the 'HelpMessage' parameter option. Just wanted to give you that update, and the forum post got locked due to my lack of timely response.

Thanks,
Glen
I was able to reproduce this. This will be fixed in a future release of PowerShell Studio.
Brittney
SAPIEN Technologies, Inc.
This topic is 3 years and 8 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.