PowerShell script for rebuilding ASP.NET

# build
msbuild /t:Rebuild /v:q
# kill aspnet
get-process aspnet_wp | kill
# reset iis
iisreset
# clear log4net logs
del -force c:\logs\*.*
# poke the webpage so that IIS/ASP.NET will load the webapp
get-url http://localhost/TestProject/TestPage.aspx | out-null

 

You'll need the Power Shell Community Extensions for the last get-url cmdlet.