Register
: :
Login
Home
News
Forums
Scripts
User Groups
Resources
About
Forums
Search
Members
Unanswered
Active Topics
Forums
>
PowerShell Development
>
Cmdlet Development
Nested parameters in a cmdlet
Last Post 31 Mar 2009 01:43 PM by
EBGreen
. 1 Replies.
Sort:
Oldest First
Most Recent First
Prev
Next
You are not authorized to post a reply.
Author
Messages
Random Bits
New Member
Posts:6
31 Mar 2009 01:40 PM
Consider the following command. /drawshape is a parameter which requires a supporting parameter /shape. /shape can not be used if /drawshape is not preceding it. Similarly /radius is a dependent parameter for /shape. It can be used only if the shape is circle.
graphix /drawshape /shape:circle /radius:10
graphix /drawshape /shape:square /side:20
Can this be implemented in cmdlets in powershell? It is a nested parameter situation.
EBGreen
Advanced Member
Posts:855
31 Mar 2009 01:43 PM
In V2 I think you might be able to do this with the ParameterSet Attribute but I have not tried to do it myself.
"Look Ma...no strings!"
You are not authorized to post a reply.
Using PowerShell
--General PowerShell
--Books, Tools, and Videos
--Exchange Server
--Active Directory
--System Center Family
--Non-Microsoft Products
--SharePoint
--SQL Server
--Working with .NET
--Peer Review
--Testing, Testing...
PowerShell Development
--Cmdlet Development
--PSDrive Provider Development
--Hosting the Shell
Looking Ahead
--Using PowerShell v2.0
--Developing for PowerShell v2.0
PowerShellCommunity.org
--Community Announcements and Assistance
--Completely Unrelated
--User Groups
--Community Business
----Suggestion Box
Forums
>
PowerShell Development
>
Cmdlet Development
Active Forums 4.3
Sponsored by Quest Software • SAPIEN Technologies • Compellent • Microsoft Windows Server 2008 R2