-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-dkp.ps1
39 lines (33 loc) · 1.13 KB
/
update-dkp.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#########################################################################
# Name: update-dkp.ps1
# Version: 1.0
# Author: Peter Provost <[email protected]>
#
# Usage: update-dkp
#
# Remarks: This is a simple powershell script for updating your
# dkpsystem.com raid leader data files.
#
# Configuration - change these as needed
if (test-path "HKLM:\SOFTWARE\Blizzard Entertainment\World of Warcraft")
{
$wowDir = (Get-ItemProperty -path "HKLM:\SOFTWARE\Blizzard Entertainment\World of Warcraft").InstallPath;
$wowAddonDir = join-path $wowDir "Interface\Addons";
}
else
{
$wowAddonDir = "C:\Program Files\World of Warcraft\Interface\Addons";
}
$uri = "http://benethugs.dkpsystem.com/luadkp.php"
$target = join-path $wowAddonDir "GuildRaidSnapShot\GRSS_Data.lua"
$wc = new-object System.Net.WebClient;
if (test-path $target)
{
write-host "Backing up existing $target..." -noNewLine;
$backup = join-path $wowAddonDir "GuildRaidSnapShot\GRSS_Data.lua.bak"
copy-item -path $target -destination $backup -force
write-host "done.";
}
write-host "`tDownloading $uri to $($target)..." -noNewLine;
$wc.DownloadFile( $uri, $target );
write-host "done.";