I'm having an issue with passing arguments to an executable through powershell.

The command that I pass is: .\migrator.exe migrate -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. Do I need to be passing this into an array object or wrapping it with quotes or what?

有帮助吗?

解决方案

If you are on PowerShell v3 or higher, you can have PowerShell pass the parameters to migrate.exe much like CMD would by using the --% operator e.g.:

.\migrator.exe migrate --% -d12345,12333,12222 -i09877,787896,76866
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top