Support Forums

PowerShell Studio: Add PrimalSense for ValidateSet parameters

Post feature requests, product enhancement ideas, and other product-specific suggestions here. Do not post bug reports.
Forum rules
Do not post any licensing information in this forum.
User avatar
OldLost
Posts: 55
Joined: Mon Jul 22, 2013 7:32 am

PowerShell Studio: Add PrimalSense for ValidateSet parameters

Postby OldLost » Mon May 15, 2017 3:25 pm

Sorry if this has already been requested; a quick search of this forum did not turn up any results for me.

While I know we can do this ourselves on a function-by-function basis using CustomSense/Triggers.xml, it would be nice if PSS would actually recognize function parameters defined using ValidateSet and offer those values when coding a call to the function and that parameter.

Hopefully I've made myself clear; if not I'll try to clarify.

ValidateSet parameters and the accepted values can be found using this piece of code:
Get-Command -pv c | Select-Object Parameters | % {$_.Parameters} | Select-Object -ExpandProperty Values -pv p |
Select-Object -ExpandProperty Attributes |
? { $_.TypeId.Name -eq 'ValidateSetAttribute' } | % {'{0} {1} = {2}' -f $c.Name,$p.Name,($_.ValidValues -join ', ') }
User avatar
Bosparan
Posts: 251
Joined: Sun Mar 03, 2013 12:45 pm

Re: PowerShell Studio: Add PrimalSense for ValidateSet parameters

Postby Bosparan » Wed May 17, 2017 8:53 am

Hi,

it already does that, at least as far as I can reproduce.

Cheers,
Fred
Attachments
PrimalSense.png
PrimalSense.png (9.26 KiB) Viewed 88 times
User avatar
OldLost
Posts: 55
Joined: Mon Jul 22, 2013 7:32 am

Re: PowerShell Studio: Add PrimalSense for ValidateSet parameters

Postby OldLost » Wed May 17, 2017 1:01 pm

Try something like Export-Csv -Encoding

5-17-2017 12-59-40 PM.jpg
5-17-2017 12-59-40 PM.jpg (52.08 KiB) Viewed 79 times


So, not so much. And it also doesn't seem to work with functions defined in modules I've written and imported either.
User avatar
Bosparan
Posts: 251
Joined: Sun Mar 03, 2013 12:45 pm

Re: PowerShell Studio: Add PrimalSense for ValidateSet parameters

Postby Bosparan » Fri May 19, 2017 3:25 am

Yes, I can reproduce your issue.
It should work though - it certainly used to (unless I have a massive memory failure going here ...). Probably a bug that it doesn't.

Return to “Wish List and Feature Requests”

Who is online

Users browsing this forum: No registered users and 1 guest