Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ant command from powershell - dot used as delimiter for parameter?

Tags:

powershell

ant

I'm trying to run an ant task which I'm invoking from a powershell script:

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

The $testsuite variable is a string which includes a dot character, e.g. "systemTest.All", so:

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

My problem is that the dot seems to be interpreted as a delimiter (by powershell? Invoking from cmd works just fine), hence the "All" part gets treated as a ant target (among with clean compile run).

(The use of a dot in the testsuite name is not one of mine doings so that part I can not affect)

Do I need to qoute the ant argument, escape the dot in some way?

Br, Pete

like image 739
PistolPete Avatar asked Feb 17 '23 02:02

PistolPete


1 Answers

Try this (but I can't test it), run this directly w/o invoke-Expression:

ant -f $antFilePath "-Dtestsuite=$testsuite" clean compile run
like image 108
CB. Avatar answered May 02 '23 09:05

CB.