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.

Plan: Wiki Bot

Many companies now have Wiki's.  A lot of wiki's can do with a nice clean-up bot to do maintenance.  So the plan is this:

Write a wiki bot.

  1. Go from a specified page.
  2. When visiting a page
    1. Run rules on the page for formatting - RegEx replace
    2. If nothing is done, go to the next url
    3. Once a certain threshold of edits are reached per day, stop (did enough damage for one day - this also restricts the amount of wiki-recent-changes everyone sees every morning.  If the bot did 300 edit overnight people will miss the real edits)
  3. Make a list of the vist schedule.
  4. If there are no links, go to the home page and grab 5 random links.
  5. Keep this schedule in a section on the user's home page.
  6. Do one page, then update the home page with the visit schedule.
  7. User can update schedule.

Thoughts:

  • Haywire bots butchering the wiki
  • Authentication
  • Accessing the wiki via web service interface (if it has one)