switch后面的-file参数是用来做什么的?2017年6月3日 在 变量-函数-脚本-条件-循环-参数 来自 PowerShell交流中心 › 分类: 变量-函数-脚本-条件-循环-参数 › switch后面的-file参数是用来做什么的? 0 赞 踩 GanZiQim asked 8 年 ago 今天用ise写switch时发现switch关键字后面可以加上-file,请问这个参数是用来做什么的? GanZiQim replied 8 年 ago 自问自答,刚刚查了一下资料,-file关键字用于从文件里面导入参数输入到switch中,具体的结构如下: switch [-regex|-wildcard|-exact] -casesensitive] -file filename { “string”|number|variable|{expression} { statement } default { statement } }
自问自答,刚刚查了一下资料,-file关键字用于从文件里面导入参数输入到switch中,具体的结构如下:
switch [-regex|-wildcard|-exact] -casesensitive] -file filename
{
“string”|number|variable|{expression} { statement }
default { statement }
}