I'm trying something really simple here, but can't figure out where I'm going wrong. I've found many other useful discussions of this - particularly here - but haven't found anything that covers my specific scenario.
In powershell, I have typed the following:
$path = "c:\program files\"
$path2 = "c:\program files\fred2\"
echoargs $path $path2
echoargs "$path" "$path2"
In both calls to echoargs, I get
Arg 0 is <c:\program files" c:\program>
Arg 1 is <files\fred2">
back as the result. How can I get the parameters to be passed through correctly?
NB: In my real script the path variables are built up from a few config parameters, so I can't just pass them directly in single quotes.