0

Running a post-build powershell command and my path has spaces as does the two args I'm trying to pass. I have no idea how to get this to work. One of the issues is a fun little double-quote that is showing up. Ultimately the following is what I'm looking for........

powershell -file "$(ProjectDir)PS\upgradeApp.ps1" -projDir "$(ProjectDir)" -targetDir "$(TargetDir)"

Note -- projDir has spaces as does targetDir. Fine, let's just get the first arg....

powershell -file "$(ProjectDir)PS\upgradeApp.ps1" -projDir "$(ProjectDir)"

What happens then is I'm mysteriously left with a trailing double-quote for the projectDir arg. Why?

C:\Users\user.domain\Documents\Visual Studio 2015\Projects\WikiAdditions\WikiAdditions"

I've tried putting in single quotes, then double-quotes but then I get a trailing single quote. So what's the magic formula here?

1 Answer 1

2

Finally figured it out........... thanks for the headache Powershell, because that looks logical.

powershell.exe –command "& { &'$(ProjectDir)PS\upgradeApp.ps1' '$(ProjectDir)' '$(TargetDir)' }"
Sign up to request clarification or add additional context in comments.

1 Comment

Far out you just saved me! I spent hours on this - HOW DOES THAT MAKE ANY SENSE?!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.