mirror of
https://github.com/onyx-and-iris/q3rcon-ps.git
synced 2025-01-19 01:00:52 +00:00
add script entry point
This commit is contained in:
parent
4966bee0b8
commit
61f7afb9f7
@ -75,7 +75,8 @@ Function Get-ConnFromPSD1 {
|
|||||||
return Import-PowerShellDataFile -Path $configpath
|
return Import-PowerShellDataFile -Path $configpath
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
Function Main {
|
||||||
|
try {
|
||||||
$conn = Get-ConnFromPSD1
|
$conn = Get-ConnFromPSD1
|
||||||
$rcon = Connect-Rcon -hostname $conn.host -port $conn.port -passwd $conn.passwd
|
$rcon = Connect-Rcon -hostname $conn.host -port $conn.port -passwd $conn.passwd
|
||||||
Write-Host $rcon.base.ToString() -ForegroundColor Green
|
Write-Host $rcon.base.ToString() -ForegroundColor Green
|
||||||
@ -88,7 +89,13 @@ try {
|
|||||||
FinalizeForm($form)
|
FinalizeForm($form)
|
||||||
|
|
||||||
[void] $form.ShowDialog()
|
[void] $form.ShowDialog()
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
Disconnect-Rcon -rcon $rcon
|
Disconnect-Rcon -rcon $rcon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if ($MyInvocation.InvocationName -ne '.') {
|
||||||
|
Main
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user