Skip to content

About

A Comprehensive PowerShell Tool for Simple Automated Game Server Management.

Topics

Resources

Stars

145 stars

Watchers

6 watching

Forks

Repository files navigation

PowerShellGSM

PowerShellGSM Banner

A Comprehensive PowerShell Tool for Simple Automated Game Server Management.

GitHub release GitHub issues

Features

  1. Hassle-free "setup and forget" experience
  2. Automated installation of game servers
  3. Streamlined single-file configuration
  4. Automatic server updates upon new version releases
  5. Monitoring for detecting server crashes and available updates
  6. Built-in thread isolation and priority management
  7. Automatic start after a system reboot
  8. Daily server restarts with in-game broadcasts for supported games
  9. Automated, lightweight backups with archiving for 7 days and 4 weeks
  10. Full configurability, allowing customization according to your preferences
  11. Open-Source with a great community supporting the tool.

Supported Games

  • 7 Days to Die
  • Ark: Survival Ascended
  • Astroneer
  • Conan Exiles
  • Enshrouded
  • Icarus
  • Insurgency Sandstorm
  • Killing Floor 2
  • Left 4 Dead 2
  • Mordhau
  • Minecraft (Paperclip)
  • Necesse
  • Palworld
  • PixArk
  • Project Zomboid
  • Rust
  • Satisfactory
  • Squad
  • Starbound
  • Stationeers
  • Terraria
  • The Forest
  • Valheim
  • Valheim Plus
  • V Rising

Advantages

  • Faster than the other available tools
  • Lighter and more targeted backups
  • Modular
  • Expandable
  • Customizable

Installation

Manual Installation

Before you begin, note that this tool is not intended to run on your primary gaming computer. Ideally, use a virtual machine on a dedicated server or a secondary computer. If you still want to use this tool on your main computer, you should consider disabling the monitoring features. Otherwise, the Task Scheduler will briefly open a cmd window for a tenth of a second every 5 minutes. You can disable this by turning off the monitoring features (AutoUpdates, AutoRestartOnCrash, AutoRestart) in the game server configuration file or by disabling the game server monitoring task created in the Windows Task Scheduler after the second launch of the server.

  1. Install Git and your preferred IDE, such as VSCode.
  2. Ensure that your File Explorer is set to display file extensions.
  3. Clone this repository using Git (F1 then Git:Clone in VSCode) or extract the zip file anywhere. (Preferably C:, but any directory will work unless the path is too long)
  4. Copy the desired server configuration file from the templates folder to the configs folder.
    • Example: Copy icarus.psm1 from templates to configs.
  5. Edit the copied configuration file to customize your server settings.
  6. Copy and rename launchers/run.cmd to match your server configuration file.
    • Example: Rename run.cmd to icarus.cmd to start icarus.psm1.
    • The filename in launchers must match the one in configs.
  7. Launch your server by double-clicking on your icarus.cmd file from the launchers folder.
  8. The PowerShell window will open, install the server, and stop the server to allow you to edit the server configuration files.
  9. After editing your config files, run the icarus.cmd file from launchers again.
  10. On the second launch, it will start the server and configure the scheduled task to keep the server running and updated.
  11. To disable a server, use the Windows Task Scheduler application to disable or delete the corresponding Scheduled Task.
  12. Forward the server ports in your router and configure the Windows firewall. You can also disable the Windows firewall entirely, but ensure that you still forward the ports in your router.

Global Settings

Tool-wide settings live in defaults.psm1. Do not edit it: it is part of PowerShellGSM and is overwritten by updates. To change a setting, copy override.example.psm1 to override.psm1 and keep only the settings you want to change. override.psm1 is not tracked by git, so updates never touch it.

Upgrading from a version with global.psm1: move your changes to override.psm1. global.psm1 is no longer used.

Automatic PowerShellGSM Updates

When AutoUpdateTool is $true (the default), PowerShellGSM registers a PowerShellGSM-Update scheduled task that runs update.ps1 every ToolUpdateFrequency hours (24 by default). It resets the installation to the latest upstream version, overwriting any local change to PowerShellGSM's own files. Your configs, launchers, servers, backups, logs and override.psm1 are not tracked by git and are kept. This requires an installation cloned with Git. Set AutoUpdateTool to $false to remove the task on the next run.

Scheduled Task Options

Both are off by default. After changing one, delete the Tasks-* and PowerShellGSM-Update tasks in the Task Scheduler; they are registered again on the next run.

  • TaskHeadless: start the tasks through conhost.exe --headless, so no console window flashes every few minutes.
  • TaskRunWhileLoggedOff: run the tasks whether the user is logged on or not (S4U logon, no password stored), so the servers start after a reboot without auto-logon. Servers then run in the background with no window, and the tasks cannot reach network shares. Some servers need a logged-on desktop and will not work this way.

Unattended Installs

By default, the first launch of a new server installs it, starts it once so it generates its files, then stops and waits so you can edit them. Set StopAfterFreshInstall to $false for unattended installs (for example from a provisioning tool): PowerShellGSM then restarts the server once after its first install, so the configuration from the server's config file is applied to the files the server just generated, and the server keeps running.

Requirements

  • A Windows machine with at least PowerShell 5.1 (Windows 10 or Server 2016+)
  • Some basic PowerShell knowledge.
  • Some networking basics to configure port forwarding.
  • The Windows user running the script should have admin privileges but should not run it with admin privileges.

Frequent Game Server Requirements

Optional Additional Packages

Install-Module -Name 7Zip4Powershell

Expanding the Code

You can create pull requests for changes to this project.

Please follow the current structure and formatting.

If you want to add support for more games, copy one of the configuration files and edit the values and launch parameters. You can then create a pull request to include your configuration here.

Disclaimer

I am in no way responsible for anything that this script will do; you are responsible for reading and understanding what this script will do before executing it.

This script will download and install third-party software like SteamCMD, ARRCON, mcrcon, Java, Microsoft XNA, Paperclip, Terraria, and any games you try to install.

About

A Comprehensive PowerShell Tool for Simple Automated Game Server Management.

Topics

Resources

Stars

145 stars

Watchers

6 watching

Forks

Releases

Sponsor this project

Contributors

Languages