Post-build powershell script

Question:

I have the following post-build event:

and PS script beginning with:

when MSBuild trys to run it, my first parameter "$(SolutionDir)" is splitted in two parameters because the solution path contains a space character: D:\Projects\Dion2 Mercurial\repo\Dion2Web\. So my script receives D:\Projects\Dion2 as the first parameter and Mercurial\repo\Dion2Web\ as the second one.

What is the correct way to send those parameters to the script file?

Note: such post-build scripts works fine when script has only one parameter.

Answer:

Try adjusting your post build event to use the following:

Source:

Post-build powershell script by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply