Files
wow-dev-server-toggle/switch_server.ps1
2023-09-14 22:26:30 -04:00

23 lines
891 B
PowerShell
Executable File

$folderPath = "[Replace with your path to Wow\Data\enUS\]"
# Check if realmlist.wtf and realmlist.prod.wtf exist
$realmlistExists = Test-Path "$folderPath\realmlist.wtf"
$realmlistProdExists = Test-Path "$folderPath\realmlist.prod.wtf"
# Check if realmlist.dev.wtf exists
$realmlistDevExists = Test-Path "$folderPath\realmlist.dev.wtf"
if ($realmlistExists -and $realmlistProdExists) {
Rename-Item "$folderPath\realmlist.wtf" "realmlist.dev.wtf" -Force
Rename-Item "$folderPath\realmlist.prod.wtf" "realmlist.wtf" -Force
Write-Host "Switching to production server"
}
elseif ($realmlistExists -and $realmlistDevExists) {
Rename-Item "$folderPath\realmlist.wtf" "realmlist.prod.wtf" -Force
Rename-Item "$folderPath\realmlist.dev.wtf" "realmlist.wtf" -Force
Write-Host "Switching to local dev server"
}
else {
Write-Host "Files not found or conditions not met"
}