mirror of
https://github.com/onyx-and-iris/q3rcon-ps.git
synced 2026-02-21 00:59:11 +00:00
27 lines
508 B
PowerShell
27 lines
508 B
PowerShell
[cmdletbinding()]
|
|
param()
|
|
|
|
Import-Module ../lib/Q3Rcon.psm1
|
|
|
|
function Get-ConnFromPSD1 {
|
|
$configpath = Join-Path $PSScriptRoot 'config.psd1'
|
|
return Import-PowerShellDataFile -Path $configpath
|
|
}
|
|
|
|
try {
|
|
$conn = Get-ConnFromPSD1
|
|
$rcon = Connect-Rcon -hostname $conn.host -port $conn.port -passwd $conn.passwd
|
|
|
|
$rcon.Map()
|
|
|
|
'Rotating the map...'
|
|
$rcon.MapRotate()
|
|
|
|
Start-Sleep -Seconds 3 # wait for map to rotate
|
|
|
|
$rcon.Map()
|
|
}
|
|
finally {
|
|
Disconnect-Rcon -rcon $rcon
|
|
}
|