Multiple params in cmdlet

Hi,

Im in powershell for couple years now, but still I have doubts how to manage multiple params in custom c# cmdlet's. I don't like having multiple if's. 

Do you have some solution on this, maybe some pattern?

regards.

pw.

May 24th, 2015 2:48pm

What C# CmdLets.  C# does not have CmdLets.

What are you asking.

You can have many Params in CmdLets.  It all depends on what you need them for.

Look at the Advanced Functions created by other users to see how they use params. If statements have nothing to do with params. THey are a programming construct used to build decision logic.  That decision logic may or may not include parameters.

Free Windows Admin Tool Kit Click here and download it now
May 24th, 2015 4:33pm

Hi PW,

Please post your current powershell script and the issue for more efficient support.

If you want to build param in powershell function, please refer to these articles:

Windows PowerShell: Defining Parameters

about_Functions_Advanced_Parameters

Use PowerShell to Make Mandatory Parameters

If there is anything else regarding this issue, please feel free to post back.

Best Regards,

Anna Wang

May 25th, 2015 4:06am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics