来自powershell的ant命令 - dot用作参数的分隔符?

时间:2013-03-21 11:33:25

标签: powershell ant

我正在尝试运行一个我正在从PowerShell脚本调用的ant任务:

Invoke-Expression "ant -f $antFilePath -Dtestsuite=$testsuite clean compile run"

$ testsuite变量是一个包含点字符的字符串,例如“systemTest.All”,所以:

Invoke-Expression "ant -f $antFilePath -Dtestsuite=systemTest.All clean compile run"

我的问题是点似乎被解释为分隔符(通过powershell?从cmd调用工作得很好),因此“全部”部分被视为一个蚂蚁目标(在干净的编译运行中)。

(在testuite名称中使用点不是我的行为之一,因此第一部分不能影响)

我是否需要输入ant参数,以某种方式逃避点?

BR, 皮特

1 个答案:

答案 0 :(得分:7)

试试这个(但是我无法测试它),直接用w / o invoke-Expression:

运行它
ant -f $antFilePath "-Dtestsuite=$testsuite" clean compile run