What are the rules of string expansion in command mode? If on cmd.exe, I would write this:
c:\asdoc.exe -doc-sources+=src
I need to convert this to a string where the actual source path ("src") is computed so somewhere above this line, $sourcePath = "src" is executed. Now I need to transform that cmd.exe command to PowerShell command. I have tried the following but it doesn't work:
& c:\asdoc.exe -doc-sources+=$sourcePath # does NOT work
& c:\asdoc.exe -doc-sources+="$sourcePath" # does NOT work
& c:\asdoc.exe -doc-sources+=($sourcePath) # does NOT work
I used the EchoArgs utility and it gives me these results:
Arg 0 is <-doc-sources+=$sourcePath> # case 1
Arg 0 is <-doc-sources+=$sourcePath> # case 2
Arg 0 is <-doc-sources+=> # case 3
Arg 1 is <src path>
How do I make the string expand "correctly" in this example?