Entries from July 1, 2007 - July 31, 2007

Tuesday
Jul242007

Something Mark Dasco and I dug up

I'm just going to blog it so I don't need to remember it.

powershell -nologo -command "& {c:\test.ps1}"

executes the powershell script from old command prompt (or scheduled tasks).

Tuesday
Jul242007

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.

Monday
Jul092007

Transformers

I realized what I need.

A transformers desktop.

When you double click a folder, it does a massive transformation sequence to open up!

:-D

The movie broke $125 million for opening week, made record for a "non-sequel" film beating even Spiderman back in its day.

Now I can rest, because there's going to be a Transformers 2 now!

Wednesday
Jul042007

A "which command" cmdlet script

PS C:\> (get-item env:path).value.split("") | where { $_ -ne "" } | where { test-path( join-path $_ "msbuild.exe" ) }

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

 

 

Next task, make it a parameterized cmdlet

Tuesday
Jul032007

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)