title: calling target exec power shell command that has spaces in file paths
body: <p>I am trying to call a BAT via a Visual Studio Target exec command but it errors out when there are spaces in the file path. I tried enclosing it with a <code>&amp;quot;</code> but it still fails. </p>
  
  <p>Error: </p>
  
  <pre><code>1&gt;Task "CreateProperty" (TaskId:58)
  1&gt;  Task Parameter:Value=C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\..\..\..\_postBuild\codeSigning.bat (TaskId:58)
  1&gt;  Output Property: batPath=C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\..\..\..\_postBuild\codeSigning.bat (TaskId:58)
  1&gt;Done executing task "CreateProperty". (TaskId:58)
  1&gt;Using "Exec" task from assembly "Microsoft.Build.Tasks.Core, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a".
  1&gt;Task "Exec" (TaskId:59)
  1&gt;  Task Parameter:Command=%WINDIR%\SysNative\WindowsPowerShell\v1.0\powershell.exe "C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\..\..\..\_postBuild\codeSigning.bat" "C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\HOK.BetaToolsManager\bin\2018\HOK.BetaToolsManager.dll" (TaskId:59)
  1&gt;  %WINDIR%\SysNative\WindowsPowerShell\v1.0\powershell.exe "C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\..\..\..\_postBuild\codeSigning.bat" "C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\HOK.BetaToolsManager\bin\2018\HOK.BetaToolsManager.dll" (TaskId:59)
  1&gt;  C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK : The term 'C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK' is  (TaskId:59)
  1&gt;  not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or  (TaskId:59)
  1&gt;  if a path was included, verify that the path is correct and try again. (TaskId:59)
  1&gt;  At line:1 char:1 (TaskId:59)
  1&gt;  + C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK. ... (TaskId:59)
  1&gt;  + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (TaskId:59)
  1&gt;      + CategoryInfo          : ObjectNotFound: (C:\Users\ksobon...evit-Addins\HOK:String) [], CommandNotFoundException (TaskId:59)
  1&gt;      + FullyQualifiedErrorId : CommandNotFoundException (TaskId:59)
  1&gt;    (TaskId:59)
  1&gt;C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\HOK.BetaToolsManager\HOK.BetaToolsManager.csproj(332,5): error MSB3073: The command "%WINDIR%\SysNative\WindowsPowerShell\v1.0\powershell.exe "C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\..\..\..\_postBuild\codeSigning.bat" "C:\Users\ksobon\source\repos\HOK-Revit-Addins\HOK Beta Tools\src\HOK.BetaToolsManager\HOK.BetaToolsManager\bin\2018\HOK.BetaToolsManager.dll"" exited with code 1.
  1&gt;Done executing task "Exec" -- FAILED. (TaskId:59)
  1&gt;Done building target "CopyFiles" in project "HOK.BetaToolsManager.csproj" -- FAILED.: (TargetId:82)
  </code></pre>
  
  <p>Here's my target call: </p>
  
  <pre><code>  &lt;Target Name="CopyFiles" AfterTargets="AfterBuild"&gt;
      &lt;CreateProperty Value="$(SolutionDir)..\..\..\_postBuild\codeSigning.bat"&gt;
        &lt;Output PropertyName="batPath" TaskParameter="Value"/&gt;
      &lt;/CreateProperty&gt;
      &lt;Exec Command="%WINDIR%\SysNative\WindowsPowerShell\v1.0\powershell.exe &amp;quot;$(batPath)&amp;quot; &amp;quot;$(TargetPath)&amp;quot;"/&gt;
    &lt;/Target&gt;
  </code></pre>
  
  <p>The error is pretty clear about what the issue is. The path has spaces in it and makes power shell think that's a command. How do I fix this? </p>