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.
Locked
User avatar
OldLost
Posts: 55
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Mon Jul 22, 2013 7:32 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.  
  3. Select-Object -ExpandProperty Attributes |
  4.  
  5. ? { $_.TypeId.Name -eq 'ValidateSetAttribute' } | % {'{0} {1} = {2}' -f $c.Name,$p.Name,($_.ValidValues -join ', ') }

Bosparan
Posts: 282
Joined: Sun Mar 03, 2013 12:45 pm

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

User avatar
OldLost
Posts: 55
Joined: Mon Jul 22, 2013 7:32 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 1863 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: 282
Joined: Sun Mar 03, 2013 12:45 pm

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.

Locked