Geek Noise
Rants, rambles, news and notes by Peter Provost
27

Yet Another PowerShell + WoW Hack

Saturday, 27 January 2007 11:37 by Peter Provost

Today I was cleaning out my World of Warcraft SavedVariables folder, which is where WoW addons keep state between sessions. Over time I have installed and uninstalled a number of addons and figured I should clean up a bit.

First I decided to hunt down all files that were for an addon I don't have any more:

function strip-extension ([string] $filename) 
{
[system.io.path]::getfilenamewithoutextension($filename)
} 
$addonsDir = 'C:\World of Warcraft\Interface\Addons' 
$savedVars = 'C:\World of Warcraft\WTF\Account\<MyAccountName>\
SavedVariables' 
ls $savedVars\*.lua | ? { (test-path (join-path -path $addonsDir 
-childPath (strip-extension($_.Name)))) -eq $false } | rm

Then I realized that I had forgotten to delete the .bak files that may have been created by upgrades, so I created this little command clean those up:

ls *.bak | ? { (test-path (strip-extension $_.Name)) -eq $false } | rm 

Have I mentioned how much I love PowerShell?

(Note: I artificially wrapped some of those lines to make them show up nicely in the blog.)

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Tags:   ,
Categories:   Technology
Actions:   E-mail | del.icio.us | Permalink | Comments (0) | Comment RSSRSS comment feed
Comments are closed