Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Cmdlet parameter validation

Avatar of elimesika
elimesikaFlag for Israel asked on
Powershell
5 Comments1 Solution665 ViewsLast Modified:
HI

I have an application that is accessible via web portal, WPF client and Powershell
Now, there are many data entry forms in the web client and WPF client, each with several controls when each control has it's own validation (generally ,  a range of values)
What I am trying to do is to define all those constants in one place and use them across all clients, however , I have found that in Powershell I have to give the values (see ValidateRange in sample code) and can not give any expression (or method call) while in other client types it is naturally supported.
Is there a way to overcome this??? or I should start thinking of some kind of pre-processing on my C# Cmdlets sources???
[Parameter(
              ParameterSetName = "details",
               ValueFromPipelineByPropertyName = true,
            HelpMessage = "Desktop disk size in GB")]
        [ValidateRange(10,250)]
        public int diskSize
        {
            get { return _diskSize; }
            set { _diskSize = value; }
        }
ASKER CERTIFIED SOLUTION
Avatar of BSonPosh
BSonPoshFlag of United States of America image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answers