Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - About Creating ParameterSets for a function

Reply
 
Old 07-06-2006   #1 (permalink)
dance2die


 
 

About Creating ParameterSets for a function

Ok, the subject says it all...
How can I create parametersets for a function?

I have no clue how to get started nor was I able to find any documents on
this...


My System SpecsSystem Spec
Old 07-06-2006   #2 (permalink)
Bruce Payette [MSFT]


 
 

Re: About Creating ParameterSets for a function

Unfortunately we don't support this in V1 but it's high on the list for the
next version.

--
Bruce Payette [MSFT]
Windows PowerShell Technical Lead
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.



"dance2die" <dance2die@discussions.microsoft.com> wrote in message
news:462C480C-6CD7-4D2B-96CF-DAD2749CA5DC@microsoft.com...
> Ok, the subject says it all...
> How can I create parametersets for a function?
>
> I have no clue how to get started nor was I able to find any documents on
> this...
>



My System SpecsSystem Spec
Old 07-06-2006   #3 (permalink)
dance2die


 
 

Re: About Creating ParameterSets for a function

thank you for clearing that up, bruce.
By the way, that means, i would have to work around this problem i have...
I am basically trying to return a DataAdater of different types
depending on .NET data provider name(SqlClient, OleDb, etc).
But, overloaded DataAdaters Construtors take different parameters.
e.g.)
1. command object
2. command text and connection
3. command text and connection string
What would be a best practice to accept those distinct sets of data without
using parametersets?


"Bruce Payette [MSFT]" wrote:

> Unfortunately we don't support this in V1 but it's high on the list for the
> next version.
>
> --
> Bruce Payette [MSFT]
> Windows PowerShell Technical Lead
> Microsoft Corporation
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
> "dance2die" <dance2die@discussions.microsoft.com> wrote in message
> news:462C480C-6CD7-4D2B-96CF-DAD2749CA5DC@microsoft.com...
> > Ok, the subject says it all...
> > How can I create parametersets for a function?
> >
> > I have no clue how to get started nor was I able to find any documents on
> > this...
> >

>
>
>

My System SpecsSystem Spec
Old 07-06-2006   #4 (permalink)
/\\/\\o\\/\\/


 
 

Re: About Creating ParameterSets for a function

the best I could come up with ($o1,$o2,$o3 = $args for CLI testing}:
a double Switch :

PoSH>$o1 = 'foo'
PoSH>$o2 = 'Bar'

PoSH>Switch (@($o1,$o2,$o3 |? {$_ -ne $null}).count) {
>> 1 {if ($o1 -ne 0){"1 parameter o1 filled"}}
>> 2 {if ($o1 -ne 0){"2 parameter o1 filled"}}
>> }
>>

2 parameter o1 filled

gr /\/\o\/\/

dance2die wrote:
> thank you for clearing that up, bruce.
> By the way, that means, i would have to work around this problem i have...
> I am basically trying to return a DataAdater of different types
> depending on .NET data provider name(SqlClient, OleDb, etc).
> But, overloaded DataAdaters Construtors take different parameters.
> e.g.)
> 1. command object
> 2. command text and connection
> 3. command text and connection string
> What would be a best practice to accept those distinct sets of data without
> using parametersets?
>
>
> "Bruce Payette [MSFT]" wrote:
>
>> Unfortunately we don't support this in V1 but it's high on the list for the
>> next version.
>>
>> --
>> Bruce Payette [MSFT]
>> Windows PowerShell Technical Lead
>> Microsoft Corporation
>> This posting is provided "AS IS" with no warranties, and confers no rights.
>>
>>
>>
>> "dance2die" <dance2die@discussions.microsoft.com> wrote in message
>> news:462C480C-6CD7-4D2B-96CF-DAD2749CA5DC@microsoft.com...
>>> Ok, the subject says it all...
>>> How can I create parametersets for a function?
>>>
>>> I have no clue how to get started nor was I able to find any documents on
>>> this...
>>>

>>
>>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
function to delete a function PowerShell
function not working dispite working outside the function block PowerShell
help about function PowerShell
BUG: Redirecting function contents to a file truncates function lines at the width of the console PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46