Windows PowerShell cmdlets for easily managing multiple dedicated V Rising servers on a Windows machine
Ready to install? Jump to Installation
-
Out-of-box support for PowerShell 5.1+ (which is already included in most modern Windows installations)
-
Start, Stop, Update, and Restart multiple servers with a service-like command interface
-
Automatically update server on startup
-
Servers run in the background so you can close the PowerShell window
-
Search for and customize Game, Host, and Voip settings
-
Read and tail log files
These features will be added in future releases
-
(Coming Soon!) Automatically download and install
steamcmd
andmcrcu
-
(Coming Soon!) Send system messages to players in-game from the console
-
Automatically send system messages on restart or shutdown
-
Automatically restart servers on a schedule
-
Rotate and archive log files
-
Archive save files
0.7.0 (2022-07-19)
- Monitor: prevent command errors from crashing the monitor (c3a1fd5)
Requires PowerShell 5.1 or greater
Tip: Check your PowerShell version with $PSVersionTable.PSVersion.ToString()
Tested with:
- Windows Server 2019
- Windows 10
- Windows 11
Note: Other platforms may also work that meet the minimum requirements, but have not been tested.
Install-Module -Name VRisingServerManager
OR
Follow the instructions below for Building from source
Copy the module folder into a supported module path
Tip: This module never deletes a server installation, game settings, or save data when removing a Server configuration. You may safely delete and re-create or re-import a Server configuration at any time.
Before you can run commands, you first must import the module.
Tip: Some module behavior can be temporarily customized using VRisingServerManagerFlags prior to import
Import-Module VRisingServerManager
To make creating servers easier, vrcreate uses the DefaultServersDir to suggest a path for the InstallDir, DataDir, and LogDir.
Tip: If you prefer to put the InstallDir
, LogDir
, or DataDir
in different locations (like separate drives), you can customize specific values for each path during server creation.
vrmset DefaultServersDir 'D:\VRisingServerManager\Servers'
To make managing servers easier, if you don't have steamcmd or mcrcu yet, the module will automatically prompt to download and install them to the DefaultAppsDir.
You can override this path using vrmset:
vrmset DefaultAppsDir 'D:\VRisingServerManager\Apps'
If you already have steamcmd or mcrcu installed, you can use them by setting their paths with vrmset:
vrmset SteamCmdPath 'D:\VRisingServerManager\Apps\steamcmd\steamcmd.exe'
vrmset MCRCUPath 'D:\VRisingServerManager\Apps\mcrcu\mcrcu.exe'
Note: This name must be a valid ShortName, and you can also change the InstallDir, DataDir, and LogDir after creation.
To prompt for all required values:
vrcreate
To temporarily override the DefaultServersDir:
vrcreate `
-ShortName MyServer `
-ServersDir 'C:\Servers'
To explicitely provide some (or all) values at creation:
vrcreate `
-ShortName MyServer `
-DataDir 'C:\Servers\MyServer\Data' `
-InstallDir 'C:\Servers\MyServer\Install' `
-LogDir 'C:\Servers\MyServer\Log'
List all Servers
vrget
List a specific Server
vrget MyServer
Tip: This can also be used for first-time installation
Update all Servers
vrupdate
Update a specific Server
vrupdate MyServer
Start all Servers
vrstart
Start a specific Server
vrstart MyServer
Stop all Servers
vrstop
Stop a specific Server
vrstop MyServer
Restart all Servers
vrrestart
Restart a specific Server
vrrestart MyServer
There are multiple log types which can be easily read using vrlog, please refer to the command description for a full list of log types.
The most common log type you will read is the log from the dedicated game server, known as the Game
log.
The vrlog
command defaults to the Game
log, so to read the log for a specific server, you can simply type:
vrlog MyServer
You may occasionally need to read other logs, like the logs from the process monitor.
To read a specific log for a specific server, in this example the MonitorError
log:
vrlog MyServer MonitorError
To read the last 10
lines of a log and continuously watch the log for new changes, use -Tail
and -Follow
:
vrlog MyServer Game -Tail 10 -Follow
Message all Servers
vrsay 'This is a system message'
Message a specific Server
vrsay MyServer 'This is a system message'
Note: to prevent unintentionally removing server data, this does not remove the InstallDir, DataDir, or LogDir which must be manually deleted if you wish to completely uninstall a server installation.
If you accidentally remove a server, you can easily add it again with vrcreate.
Remove all Servers
vrdelete
Remove a specific Server
vrdelete MyServer
Disabling the server monitor process will cause it to shut down, but will still leave the server process running.
Disable all Server Monitors
vrdisable
Disable a specific Server Monitor
vrdisable MyServer
Note: The server monitor automatically launches whenever running Server commands.
Enable all Server Monitors
vrenable
Enable a specific Server Monitor
vrenable MyServer
Steps to Update to a new version:
-
Stop (Disable) any running Monitor(s)
vrdisable (VRisingServer) [foo] Monitor disabled
-
Wait for Monitor(s) to Stop, then verify Monitor(s) are "Disabled"
vrget
Monitor ------- Disabled
-
Update the Module
Update-Module -Name VRisingServerManager
-
Exit the current PowerShell session
The module is compiled during import, so you must open a new powershell session after upgrading to ensure the new version is loaded correctly.
exit
-
Open a new PowerShell session
-
Import the Updated Module
Import-Module VRisingServerManager
-
Start (Re-Enable) the Monitor(s)
vrenable (VRisingServer) [foo] Monitor enabled (VRisingServer) [foo] Monitor launched
-
Verify the Monitor(s) are Running (Idle)
vrget
Monitor ------- Idle
Some module behavior can be temporarily customized by settings flags on [hashtable] $VRisingServerManagerFlags
prior to import
Supported flags:
SkipNewVersionCheck
: Disables checking for new package versions when loading the module (see: SkipNewVersionCheck).
Example:
$VRisingServerManagerFlags = @{
SkipNewVersionCheck = $true
}
Import-Module VRisingServerManager
Some settings for the manager itself can be retrieved or modified using vrmget and vrmset.
These settings are persisted to disk.
Type: boolean
Default: $false
The module will automatically check PowerShellGallery for new versions of the module.
This behavior can be disabled by setting SkipNewVersionCheck to $true
Type: string
Default: D:\VRisingServerManager\Servers
When new servers are created, their InstallDir, DataDir, and LogDir are automatically configured as a subfolder of DefaultServersDir named after their ShortName (e.g. D:\VRisingServers\MyServer
)
Example: Set the Default Servers Folder
Type: string
Default: D:\VRisingServerManager\Apps
If steamcmd or mcrcu are automatically installed, they will be installed to a subfolder of the DefaultAppsDir
Example: Set the Default Apps Folder
The Server represents a single server configuration in the manager. When using vrget, a list of Servers is returned and can be interacted with using its methods and properties.
Server configuration files are stored in C:\ProgramData\edgetools\VRisingServerManager\Servers
Type: string
The ShortName is a concise nickname for an individual Server which is used when running various manager commands.
Unlike the DisplayName, the only allowed characters are alphanumeric ( A-Z
a-z
0-9
), dash ( -
), and underscore ( _
)
Type: string
The DisplayName is what players will see when searching for the server online or connecting to it in game.
This is a Host Setting and can be modified using vrset.
Type: string
The InstallDir is where steamcmd will install the V Rising dedicated game server files.
This is a Service Setting and can be modified using vrset.
Type: string
The DataDir is where the dedicated game server will store its save files and settings.
This is a Service Setting and can be modified using vrset.
Type: string
The LogDir is where log files from the dedicated game server, server updates, and the process monitor will be written.
These files can easily be read using vrlog.
This is a Service Setting and can be modified using vrset.
Type: boolean
Default: $true
If UpdateOnStartup is enabled, steamcmd will automatically run and install any updates prior to starting or restarting the dedicated game server.
This is a Service Setting and can be modified using vrset.
Type: boolean
Default: $true
If AnnounceShutdown is enabled, mcrcu will automatically run and announce when the server is being shut down.
If ShutdownDelay is greater than 0
, a message will also be sent every minute until shutdown.
This is a Service Setting and can be modified using vrset.
Type: int
Default: 5
ShutdownDelay is the duration in minutes to wait until shutting down the server when receiving a stop or restart command.
If the value is unset or set to 0
, the server shuts down immediately.
This is a Service Setting and can be modified using vrset.
Many settings for the dedicated game server can be retrieved using vrget and modified using vrset.
A Host Setting correlates to a value in ServerHostSettings.json
inside the Settings
folder of the DataDir.
A Game Setting correlates to a value in ServerGameSettings.json
inside the Settings
folder of the DataDir.
A Voip Setting correlates to a value in ServerVoipSettings.json
inside the Settings
folder of the DataDir.
A Service Setting correlates to a configurable option when running the dedicated game server using this module.
The Process Monitors are separate PowerShell sessions which are automatically launched, one for each server, whenever a command is executed.
This allows orchestrating complex features like waiting for the ShutdownDelay and running UpdateOnStartup against multiple servers in parallel, all without blocking the operator from using the console.
Once the monitor is launched, it checks for any commands in the queue, executes them if found, and when it has nothing else to do, then it exits.
Some commands support a -Queue
option which allows the command to be queued for execution, which is useful for ensuring a task is still ran even if the monitor is currently busy.
Since it launches steamcmd and the dedicated game server in separate processes, the monitor can exit and the server will keep running.
See Technical Details for more detailed information.
Note: Most commands have convenient aliases, which are automatically configured when importing the module. Command examples will use the alias, when available.
Most commands can operate against specific server(s), which may be specified as a ShortName or using the Server object.
When using the -ShortName
, pass the name directly to the command:
vrfoo MyServer
When using -Server
, first store the server in an object using vrget:
$myserver = vrget MyServer
Then pass the object using -Server
:
vrfoo -Server $myserver
Alias: vrcreate
vrcreate [ShortName] [OPTIONS]
Creates new Server configuration on the local machine with the specified ShortName, DataDir, InstallDir, and LogDir.
-
ShortName
: Required. The ShortName to use for the new server.Tip: This value will be used when running most commands, so pick something short, concise, and easy to type.
-
-ServersDir
: Optional. A directory path to use instead of the DefaultServersDir. This value is used when generating the suggested values forDataDir
,InstallDir
, andLogDir
. Type:string
. Example:D:\VRisingServerManager\Servers
-
-DataDir
: Optional. A directory path to use for the DataDir instead of the suggested directory. Type:string
. Example:D:\VRisingServerManager\Servers\MyServer\Data
-
-InstallDir
: Optional. A directory path to use for the InstallDir instead of the suggested directory. Type:string
. Example:D:\VRisingServerManager\Servers\MyServer\Install
-
-LogDir
: Optional. A directory path to use for the LogDir instead of the suggested directory. Type:string
. Example:D:\VRisingServerManager\Servers\MyServer\Log
Alias: vrget
For retrieving a Server:
vrget [ShortNames or Servers]
- ShortNames or Servers: Required. The
Server(s)
to retrieve.
For retrieving a server Setting:
vrget [ShortNames or Servers] [SettingsType] [SettingName]
-
ShortNames or Servers: Required. The
Server(s)
to retrieve specified setting from. -
SettingsType
: Required. The Setting type to retrieve. Example:Host
-
SettingName
: Optional. The Setting name to retrieve.-
If unspecified, all values for the specified setting type will be retrieved.
-
You can use wildcards (
*
) to search for any setting names matching input.Example:
vrget MyServer Game *Castle*
-
Alias: vrset
Modifies or resets the value of a Setting for specified Server(s).
vrset [ShortNames or Servers] [SettingsType] [SettingName] [SettingValue or Default]
-
ShortNames or Servers: Required. The
Server(s)
to modify specified setting for. -
SettingsType
: Required. The Setting type to modify. Example:Host
-
SettingName
: Required. The Setting name to modify. Example:Port
-
SettingValue
or-Default
: Required. The value to assign to the specified Setting.-
If the specified value matches the default value, or if
-Default
is used instead, then any overridden value will be reset back to the default.Example:
vrset MyServer Host Port -Default
-
Alias: vrstart
vrstart [ShortNames or Servers] [OPTIONS]
Starts specified Server(s), including orchestrating UpdateOnStartup, if enabled.
- ShortNames or Servers: Required. The
Server(s)
to start.
-Queue
: Optional. Adds the command to the Monitor queue even if a command is already running. Type:switch
Alias: vrstop
vrstop [ShortNames or Servers] [OPTIONS]
Stops specified Server(s), including orchestrating AnnounceShutdown and ShutdownDelay, if enabled.
- ShortNames or Servers: Required. The
Server(s)
to stop.
-Queue
: Optional. Adds the command to the Monitor queue even if a command is already running. Type:switch
Alias: vrrestart
vrrestart [ShortNames or Servers] [OPTIONS]
Restarts specified Server(s), including orchestrating AnnounceShutdown, ShutdownDelay, and UpdateOnStartup, if enabled.
- ShortNames or Servers: Required. The
Server(s)
to restart.
-Queue
: Optional. Adds the command to the Monitor queue even if a command is already running. Type:switch
Alias: vrupdate
vrupdate [ShortNames or Servers] [OPTIONS]
Updates specified Server(s) using steamcmd.
- ShortNames or Servers: Required. The
Server(s)
to update.
-Queue
: Optional. Adds the command to the Monitor queue even if a command is already running. Type:switch
Alias: vrlog
vrlog [ShortName or Server] [LogType] [OPTIONS]
Reads a specified Server's log file from disk.
-
ShortName or Server: Required. The
Server
to read a log file from. -
LogType
: Optional. The Log type to read. Default:Game
Log types:
-
Game
The
Game
log contains the output fromVRisingServer.exe
. -
Update
The
Update
log contains the output from steamcmd during the update process. -
UpdateError
The
UpdateError
log contains error output from steamcmd during the update process. This log will typically be empty unless an error occured during an update. -
Monitor
The
Monitor
log contains the output from the process Monitor which orchestrates commands such as starting, stopping, restarting, and updating the server. -
MonitorError
The
MonitorError
log contains error output from the process Monitor. This log will typically be empty unless the monitor crashed. -
Service
The
Service
log contains any standard output fromVRisingServer.exe
. This log will typically be empty because V Rising sends the log output to theGame
log instead. -
ServiceError
The
Service
log contains error output fromVRisingServer.exe
. This log will typically be empty unless the dedicated server crashes while running, but may still be empty as errors from launching the server are generally printed to theGame
log or theMonitorError
log.
-
-
-Tail [LINES]
: Optional. Return the lastLINES
number from the log file. Default: Return all lines. -
-Follow
: Optional. Continue to watch the log file for new output and print it as it arrives. Press Ctrl+C to stop.
Alias: vrsay
vrsay [ShortNames or Servers] [Message]
Sends Server(s) a system message using mcrcon.
-
ShortNames or Servers: Required. The
Server(s)
to update. -
Message
: Required. The message to send. Type:string
.
Alias: vrdelete
vrdelete [ShortNames or Servers] [OPTIONS]
Removes specified Server configuration(s) from the local machine.
Does not remove the InstallDir, DataDir, or LogDir which must be manually deleted if you wish to completely uninstall a server installation.
- ShortNames or Servers: Required. The
Server(s)
to remove.
-Force
: Optional. Forces removal of config file even if the server is currently running or being orchestrated. Use-Force
at your own risk! Type:switch
. Default: Unset.
Alias: vrdisable
vrdisable [ShortNames or Servers]
Disables the server Monitor for specified Server(s).
- ShortNames or Servers: Required. The
Server(s)
to disable the monitor for.
Alias: vrenable
vrenable [ShortNames or Servers]
Enables the server Monitor for specified Server(s).
- ShortNames or Servers: Required. The
Server(s)
to enable the monitor for.
Alias: vrmget
vrmset [Option]
Retrieves specified VRisingServerManagerConfigOption value from the local machine.
Option
: Required. The name of the VRisingServerManagerConfigOption to retrieve.
Alias: vrmset
vrmset [Option] [Value]
Modifies the value for specified VRisingServerManagerConfigOption.
-
Option
: Required. The name of the VRisingServerManagerConfigOption to modify. -
Value
: Required. The value to set the option to.
VRising Server Manager orchestrates a series of process-tiers to monitor and manage each server.
The primary process tier is the interactive powershell process used when running Import-VRisingServerManager
. In this process, the user can query and interact with multiple servers at once. Commands issued to servers are ran asynchronously by the secondary tier.
The secondary process tier contains the background processes used to asynchronously carry out commands against each server (known as 'Monitors'). One Monitor is launched per configured server. It polls the server configuration looking for a command to run, and processes the command if found.
The third-tier processes are the dedicated game server process and the update process (steamcmd). These processes are launched and monitored by the second tier.
Orchestrating the server processes involves issuing a command from the first tier, which sets the active command for the second tier. The secondary tier then reads this command, and orchestrates any actions against its resources, including starting or stopping any third tier processes, as needed.
Because the third and second tier processes are launched in the background, the user can safely close the interactive powershell window and the third and second tiers will continue running. New powershell sessions can discover the processes in the second and third tiers by reading the configuration file from disk where the process information is kept.
Configuration for servers is stored in json files in the ProgramData
directory, which allows multiple instances of the manager to concurrently query and update server information such as the running process ID.
These configuration files are multi-process thread-safe across the application, with writes protected using named mutexes. This allows the use of automation to run manager commands from multiple sources without worrying about corrupting the state.
Server settings such as Host, Game, and Voip parameters are loaded from disk, converted into PSObjects, and combined with both their default values and any per-server overrides. Writes are then converted back to json on disk.
-
PowerShell 5.1+
-
Build the module
Invoke-Psake
-
Add the repository root directory to your
PSModulePath
so thatImport-Module VRisingServerManager
can resolve successfully.Note: This assumes the current working directory is the repository root.
$env:PSModulePath = "$($(pwd).Path);${env:PSModulePath}"
see LICENSE.txt