将中间参数设置为非强制性的三个参数 [英] Setting middle parameter as not mandatory out of three parameters

查看:93
本文介绍了将中间参数设置为非强制性的三个参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建带有三个参数的cmdlet.第一项和第三项是强制性的,而第二项不是强制性的.我无法更改这些参数的位置.我该如何实现?我需要这种情况的帮助.

我是cmdlet的新手.

预先感谢.

问候
Vipin Kumar

I am creating a cmdlet with three parameters. The first and third items are mandatory whereas the second item is not mandatory. I cannot chage the position of these parameters. How can I make it happen? I need help with this situation.

I am new to cmdlets.

Thank in advance.

Regards
Vipin Kumar

推荐答案

通常,这是通过命名参数来完成的.示例:

filename:abc.txt color:red

现在参数的顺序无关紧要.
Typically this is done through named arguments. Example:

filename:abc.txt color:red

Now the order of the parameters don''t matter.


这篇关于将中间参数设置为非强制性的三个参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆