![]() ![]() ![]() powershell.exe -ExecutionPolicy Bypass -NoProfile -NonInteractive -File post-build.ps1 Then I just added simple command to post build action to execute the script. Visual Studio executes the commands with output directory as working directory so I know where the relative paths start from. I then set this file to be copied to output directory. This way I don’t need to go to Properties window just to change something in script. To make editing easier I decided to create file post-build.ps1 (I needed just post build action). Normally for full builds I use psake or I just script it on build server as next step, but today I needed it directly in Visual Studio. Sadly in Visual Studio in fairly useful feature of post/pre build actions you can by default use only batch files. Batch files are plain simple for any real developer to use. Tabs ↹ over ␣ ␣ ␣ spaces by Jiří Činčura Using PowerShell in post/pre build action in Visual Studio ![]()
0 Comments
Leave a Reply. |