I am running into a problem executing a command using cmd.exe in PowerShell. The problem is the path to the command has spaces in it. Seems to be a general problem with PowerShell.
Below is an extract:
$base_dir = resolve-path ..\ # this path has spaces in it
$msdeploy = $base_dir\tools\msdeploy\msdeploy.exe
cmd.exe /c $("""$msdeploy"" -verb:sync -source:....")
I need to have the path to msdeploy resolve through variables as the script is used in a continuous integration process.
The command wont execute due to the spaces. I have tried to wrap the command in "" (quotes) but still no luck. How do I format the $msdeploy variable in this instance?