mirror of
https://github.com/onyx-and-iris/q3rcon-ps.git
synced 2025-01-18 16:50:52 +00:00
27 lines
516 B
PowerShell
27 lines
516 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 -Milliseconds 3000 # wait for map to rotate
|
||
|
|
||
|
$rcon.Map()
|
||
|
}
|
||
|
finally {
|
||
|
Disconnect-Rcon -rcon $rcon
|
||
|
}
|