Fix PowerShell PostBuild failing when solution path contains spaces (#3669)

Quote the $(ProjectDir) and $(TargetDir) MSBuild properties in the
Copy-Item commands so that paths with spaces are handled correctly.

Co-authored-by: Myselfish <[email protected]>
This commit is contained in:
Myself
2026-03-24 19:49:57 +01:00
committed by GitHub
co-authored by Myselfish
parent 751f1093f5
commit a2c4dc8aee
@@ -24,7 +24,7 @@
</ItemGroup>
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Condition=" '$(OS)' == 'Windows_NT' " Command="powershell -Command &quot;Copy-Item $(ProjectDir)manifest.psd1 $(TargetDir)$(TargetName).psd1&quot;" />
<Exec Condition=" '$(OS)' != 'Windows_NT' " Command="pwsh -Command &quot;Copy-Item $(ProjectDir)manifest.psd1 $(TargetDir)$(TargetName).psd1&quot;" />
<Exec Condition=" '$(OS)' == 'Windows_NT' " Command="powershell -Command &quot;Copy-Item '$(ProjectDir)manifest.psd1' '$(TargetDir)$(TargetName).psd1'&quot;" />
<Exec Condition=" '$(OS)' != 'Windows_NT' " Command="pwsh -Command &quot;Copy-Item '$(ProjectDir)manifest.psd1' '$(TargetDir)$(TargetName).psd1'&quot;" />
</Target>
</Project>