Created
November 26, 2012 06:25
-
-
Save ritalin/4146829 to your computer and use it in GitHub Desktop.
Run Powershell script from VisualStudio Post-Build-Event.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
powershell -NoProfile -ExecutionPolicy RemoteSigned -file $(ProjectDir)\post-command.ps1 |
You should put it in your .csproj like this
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell -NoProfile -ExecutionPolicy RemoteSigned -file $(ProjectDir)\post-command.ps1" />
</Target>
@dotdiego Thank you for your following up.
Still trying to figure this one out, but it looks like you need to somehow enclose your -file argument in quotes. If I execute the command in CMD it throws an exception probably because the path has spaces in it.
Figured it out:
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="powershell -NoProfile -ExecutionPolicy RemoteSigned -file "$(ProjectDir)post-command.ps1"" />
</Target>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it don't work with me