- "UpdateSourceArgs": "-NoProfile -Command \"$ProgressPreference='SilentlyContinue'; [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; $ServerVersion='{{ServerVersion}}'; Set-Location -Path 'ts6'; if ( [string]::IsNullOrWhiteSpace($ServerVersion) ) { $ServerVersion = (Invoke-RestMethod -UseBasicParsing -Uri \\\"https://api.github.com/repos/teamspeak/teamspeak6-server/releases/latest\\\").name }; if ( $ServerVersion -notmatch '^v6\\.\\d+\\.\\d+(-beta\\d*)?$' ) { Write-Output 'Invalid TeamSpeak 6 version format specified'; exit 1 } else { $TagVersion = $ServerVersion -replace '-', '/'; if ( Test-Path teamspeak6.zip ) { Remove-Item teamspeak6.zip -Force -ErrorAction SilentlyContinue *> $null }; try { Invoke-WebRequest -UseBasicParsing -Uri https://github.com/teamspeak/teamspeak6-server/releases/download/$TagVersion/teamspeak-server_win64-$ServerVersion.zip -OutFile teamspeak6.zip -ErrorAction Stop } catch { Write-Output \\\"Download failed from GitHub. Aborting\\\"; exit 1; }; Expand-Archive -Path \\\"teamspeak6.zip\\\" -DestinationPath \\\".\\\" -Force *> $null; if ( Test-Path teamspeak6.zip ) { Remove-Item teamspeak6.zip -Force -ErrorAction SilentlyContinue *> $null }; if ( Test-Path 'teamspeak-server_win64' ) { robocopy 'teamspeak-server_win64' 'server' /E /MOVE /NFL /NDL /NJH /NJS /NP *> $null; if ($LASTEXITCODE -gt 7) { exit $LASTEXITCODE } else { if ( Test-Path 'teamspeak-server_win64' ) { Remove-Item 'teamspeak-server_win64' -Recurse -Force -ErrorAction SilentlyContinue *> $null }; Write-Output \\\"TeamSpeak 6 $ServerVersion downloaded\\\" } } }\"",
0 commit comments