我尝试使用PowerShell
运行外部命令$parsePref = "--%"
$imageName = "Windows 7 Image"
& wdsutil.exe $parsePref "/Add-Image /Name:$($imageName) /FileName:WDSBoot.wim ..."
:
An invalid parameter (7) was specified for command /add-image
返回错误:$imageName
将"Windows7Image"
更改为$imageName
有效(无空格..) - 但这是不可取的。
如何处理switch (columnLength) {
case 1:
sotPoint = Point.measurement(measurementName)
.time(System.currentTimeMillis(),TimeUnit.MILLISECONDS)
.tag("source", "SOT")
.tag(attributes[0],rsObj.getString(attributes[0]))
.addField("recordcount", 1)
.build();
break;
case 2:
sotPoint = Point.measurement(measurementName)
.time(System.currentTimeMillis(),TimeUnit.MILLISECONDS)
.tag("source", "SOT")
.tag(attributes[0],rsObj.getString(attributes[0]))
.tag(attributes[1],rsObj.getString(attributes[1]))
.addField("recordcount", 1)
.build();
break;
default: System.out.println("Invalid column length");
}
变量中的空格?
答案 0 :(得分:1)
将参数括在引号中:
& wdsutil.exe $parsePref "/Add-Image /Name:""$($imageName)"" /FileName:WDSBoot.wim ..."