c# - Build Process and Powershell - Visual Studio Project -
i trying add script (possibly powershell script) visual studio c# project. goal of script re-create file every time build project. ideally script run before visual studio's build process every time want build project.
i new process , don't seem find way (or understand) way of doing this.
thank in advance help!
edit : powershell script looks like.
$file_path = 'c:\users\<username>\desktop\testscripts' $file_name = 'test.xml' $file = $file_path +'\'+ $file_name $file_exist = test-path $file if($file_exist) { remove-item $file } $file_header_comment = '<!-- file auto generated during build process -->' new-item -path $file_path -name $file_name -value $file_header_comment -itemtype file -force
in project's properties, on build events tab, invoke script on pre-build event command line. like:
powershell.exe -file myscript.ps1
Comments
Post a Comment