[英]Multiple arguments for powershell command
I'm having an issue with passing arguments to an executable through powershell. 我在通过Powershell将参数传递给可执行文件时遇到问题。
The command that I pass is: .\\migrator.exe migrate -d12345,12333,12222 -i09877,787896,76866 我传递的命令是:。\\ migrator.exe migration -d12345,12333,12222 -i09877,787896,76866
Here's where I am having an issue. 这是我遇到的问题。 The command works perfectly in CMD shell, but in powershell, it fails on the commas and will not execute the command.
该命令在CMD Shell中可以完美运行,但是在Powershell中,它在逗号上失败并且将不执行命令。 Do I need to be passing this into an array object or wrapping it with quotes or what?
我需要将其传递到数组对象中还是用引号将其包装起来?
如果您使用的是PowerShell v3或更高版本,则可以使PowerShell像使用CMD一样使用--%
运算符将参数传递给migration.exe,例如:
.\migrator.exe migrate --% -d12345,12333,12222 -i09877,787896,76866
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.