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.
Technology Tips and News
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.
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.
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