Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Param
(
[Parameter(Mandatory=$false)]
[ValidatePattern("qlive://[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+:[0-9]{5}/\S+")]
[string]$uri
)
$log_file = "$Env:TMP\quakelive_launcher.log"
if (Test-Path $log_file) {
$path, $arg = Select-String -Path $log_file -CaseSensitive -Pattern "^(?:Engine path|Launch parameters): (.*)" |
%{ $_.Matches[0].Groups[1].Value }
} else {
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
[System.Windows.Forms.MessageBox]::Show("log missing, use Launcher and try again")
exit
}
if ($uri) {
$arg += $uri -replace 'qlive://([^/]*)/(.*)', '+wait 500 +password $2 +connect $1'
}
Start-Process "$path\quakelive.exe" "$arg"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.