Skip to content

Commit

Permalink
Create example.ps1
Browse files Browse the repository at this point in the history
Example for powershell
  • Loading branch information
Ajoro committed Dec 22, 2020
1 parent 74d6b85 commit 5dbc8d2
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Powershell/example.ps1
@@ -0,0 +1,12 @@
. .\ServerStatus.ps1

$ms = ServerStatus -Address "minecraft.frag.land" -port 25565
"Minecraft server status of {0} on port {1}:" -f $ms.address, $ms.port

if ($ms.online) {
"Server is online running with {0} out of {1} players." -f $ms.current_players, $ms.max_players
"Message of the day: {0}" -f $ms.motd
"Latency: {0}ms" -f $ms.latency
}else {
"Server is offline!"
}

0 comments on commit 5dbc8d2

Please sign in to comment.