Repository: microsoft/terminal (language: cpp)

Issue:
Microsoft.Terminal.Settings.ModelLib.vcxproj fails to build due to missing $quote; in <Exec Command= ...> 
### Windows Terminal version

_No response_

### Windows build number

_No response_

### Other Software

VisualStudio 2022.

### Steps to reproduce

Microsoft.Terminal.Settings.ModelLib.vcxproj fails to build when the source directory path contains spaces (as in "P:\GitHub Projects\...").
Microsoft.Terminal.Settings.ModelLib.vcxproj has three <Exec Command=pwsh.exe ...> nodes which do not have double-quotes (&quot;) around the file spec for the GenerateHeaderForJson.ps1 file.  Without the double-quotes the execution of pwsh.exe fails.


### Expected Behavior

Modify the section of Microsoft.Terminal.Settings.ModelLib.vcxproj containing the Commands to be executed.  Following is the changed section:

  <!-- This target will take our defaults.json and stamp it into a .h file that
  we can include in the code directly. This way, we don't need to worry about
  failing to load the default settings at runtime. -->
  <Target Name="_TerminalAppGenerateDefaultsH" Inputs="defaults.json" Outputs="Generated Files\defaults.h" BeforeTargets="BeforeClCompile">
    <Exec Command="pwsh.exe -NoProfile â€“ExecutionPolicy Unrestricted &quot;$(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1&quot; -JsonFile defaults.json -OutPath &quot;Generated Files\defaults.h&quot; -VariableName DefaultJson" />
  </Target>
  <!-- A different set of defaults for Universal variant -->
  <Target Name="_TerminalAppGenerateDefaultsUniversalH" Inputs="defaults-universal.json" Outputs="Generated Files\defaults-universal.h" BeforeTargets="BeforeClCompile">
    <Exec Command="pwsh.exe -NoProfile â€“ExecutionPolicy Unrestricted &quot;$(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1&quot; -JsonFile defaults-universal.json -OutPath &quot;Generated Files\defaults-universal.h&quot; -VariableName DefaultUniversalJson" />
  </Target>
  <!-- Same as above, but for the default settings.json template -->
  <Target Name="_TerminalAppGenerateUserSettingsH" Inputs="userDefaults.json" Outputs="Generated Files\userDefaults.h" BeforeTargets="BeforeClCompile">
    <Exec Command="pwsh.exe -NoProfile â€“ExecutionPolicy Unrestricted &quot;$(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1&quot; -JsonFile userDefaults.json -OutPath &quot;Generated Files\userDefaults.h&quot; -VariableName UserSettingsJson" />
  </Target>

[Changes.txt](https://github.com/microsoft/terminal/files/8338413/Changes.txt)


### Actual Behavior

Without the additional &quot;'s in the project file, the Microsoft.Terminal.Settings.ModelLib project fails to build.


Discussion / hints:
Good catch! Someone should fix that. Feel free to open a PR if you'd like ☺️ 

Fix patch:
diff --git a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj
index c37026831c5..4d168b7724e 100644
--- a/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj
+++ b/src/cascadia/TerminalSettingsModel/Microsoft.Terminal.Settings.ModelLib.vcxproj
@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+<Project DefaultTargets="Build" ToolsVersion="15.0"
+  xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup Label="Globals">
     <ProjectGuid>{CA5CAD1A-d7ec-4107-b7c6-79cb77ae2907}</ProjectGuid>
     <Keyword>Win32Proj</Keyword>
@@ -230,8 +231,7 @@
 
   </ItemGroup>
   <ItemGroup>
-    <!-- Manually add references to each of our dependent winmds. Mark them as
-    private=false and CopyLocalSatelliteAssemblies=false, so that we don't
+    <!-- Manually add references to each of our dependent winmds. Mark them as private=false and CopyLocalSatelliteAssemblies=false, so that we don't
     propagate them upwards (which can make referencing this project result in
     duplicate type definitions)-->
     <Reference Include="Microsoft.Terminal.TerminalConnection">
@@ -285,15 +285,15 @@
   we can include in the code directly. This way, we don't need to worry about
   failing to load the default settings at runtime. -->
   <Target Name="_TerminalAppGenerateDefaultsH" Inputs="defaults.json" Outputs="Generated Files\defaults.h" BeforeTargets="BeforeClCompile">
-    <Exec Command="pwsh.exe -NoProfile –ExecutionPolicy Unrestricted $(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1 -JsonFile defaults.json -OutPath &quot;Generated Files\defaults.h&quot; -VariableName DefaultJson" />
+    <Exec Command="pwsh.exe -NoProfile –ExecutionPolicy Unrestricted &quot;$(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1&quot; -JsonFile defaults.json -OutPath &quot;Generated Files\defaults.h&quot; -VariableName DefaultJson" />
   </Target>
   <!-- A different set of defaults for Universal variant -->
   <Target Name="_TerminalAppGenerateDefaultsUniversalH" Inputs="defaults-universal.json" Outputs="Generated Files\defaults-universal.h" BeforeTargets="BeforeClCompile">
-    <Exec Command="pwsh.exe -NoProfile –ExecutionPolicy Unrestricted $(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1 -JsonFile defaults-universal.json -OutPath &quot;Generated Files\defaults-universal.h&quot; -VariableName DefaultUniversalJson" />
+    <Exec Command="pwsh.exe -NoProfile –ExecutionPolicy Unrestricted &quot;$(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1&quot; -JsonFile defaults-universal.json -OutPath &quot;Generated Files\defaults-universal.h&quot; -VariableName DefaultUniversalJson" />
   </Target>
   <!-- Same as above, but for the default settings.json template -->
   <Target Name="_TerminalAppGenerateUserSettingsH" Inputs="userDefaults.json" Outputs="Generated Files\userDefaults.h" BeforeTargets="BeforeClCompile">
-    <Exec Command="pwsh.exe -NoProfile –ExecutionPolicy Unrestricted $(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1 -JsonFile userDefaults.json -OutPath &quot;Generated Files\userDefaults.h&quot; -VariableName UserSettingsJson" />
+    <Exec Command="pwsh.exe -NoProfile –ExecutionPolicy Unrestricted &quot;$(OpenConsoleDir)\tools\GenerateHeaderForJson.ps1&quot; -JsonFile userDefaults.json -OutPath &quot;Generated Files\userDefaults.h&quot; -VariableName UserSettingsJson" />
   </Target>
   <Import Project="$(SolutionDir)build\rules\CollectWildcardResources.targets" />
 


Test patch: