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.
This topic is 6 years and 10 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.
Locked
User avatar
OldLost
Posts: 55
Last visit: Wed Feb 21, 2018 8:00 am

PowerShell Studio: Add PrimalSense for ValidateSet parameters

Post by OldLost »

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:
  1. Get-Command -pv c | Select-Object Parameters | % {$_.Parameters} | Select-Object -ExpandProperty Values -pv p |
  2. Select-Object -ExpandProperty Attributes |
  3. ? { $_.TypeId.Name -eq 'ValidateSetAttribute' } | % {'{0} {1} = {2}' -f $c.Name,$p.Name,($_.ValidValues -join ', ') }
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: PowerShell Studio: Add PrimalSense for ValidateSet parameters

Post by Bosparan »

Hi,

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

Cheers,
Fred
Attachments
PrimalSense.png
PrimalSense.png (9.26 KiB) Viewed 3513 times
User avatar
OldLost
Posts: 55
Last visit: Wed Feb 21, 2018 8:00 am

Re: PowerShell Studio: Add PrimalSense for ValidateSet parameters

Post by OldLost »

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 3504 times
So, not so much. And it also doesn't seem to work with functions defined in modules I've written and imported either.
Bosparan
Posts: 290
Last visit: Fri Oct 08, 2021 11:59 am

Re: PowerShell Studio: Add PrimalSense for ValidateSet parameters

Post by Bosparan »

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.
This topic is 6 years and 10 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.
Locked