Skip to content

Servy PowerShell Module

Akram El Assas edited this page Nov 12, 2025 · 113 revisions

The PowerShell module shipped with v3.3 and below has some issues. Use the latest one on the main branch.

The Servy PowerShell Module Servy.psm1 allows you to manage Windows services easily using PowerShell. You can install, start, stop, restart, export/import configurations, check service status, show help, display the version, and uninstall services.

Once you install Servy, Servy PowerShell module is available at:

C:\Program Files\Servy\Servy.psm1

You can find detailed examples of how to use it here.

Important: If you face any issues with the PowerShell module in automated or non-interactive environments (e.g., CI/CD, Ansible, WinRM), use -Quiet option to suppress interactive output such as spinners or loading animations.

Table of Contents

Installation

Import the module in your PowerShell session:

Import-Module "C:\Program Files\Servy\Servy.psm1" -Force

Display the version:

Show-ServyVersion -Quiet

Display help:

Show-ServyHelp

Usage Examples

Install a New Service

Install-ServyService `
  -Quiet `
  -Name "WexflowServer" `
  -Description "Wexflow Workflow Engine" `
  -Path "C:\Program Files\dotnet\dotnet.exe" `
  -StartupDir "C:\Program Files\Wexflow Server\Wexflow.Server" `
  -Params "Wexflow.Server.dll" `
  -StartupType "Automatic" `
  -EnableHealth `
  -HeartbeatInterval 5 `
  -MaxFailedChecks 1 `
  -MaxRestartAttempts 2 `
  -RecoveryAction RestartService

Export Service Configuration

Export-ServyServiceConfig `
  -Quiet `
  -Name "WexflowServer" `
  -ConfigFileType "xml" `
  -Path "C:\WexflowServer.xml"

Export-ServyServiceConfig `
  -Quiet `
  -Name "WexflowServer" `
  -ConfigFileType "json" `
  -Path "C:\WexflowServer.json"

Import Service Configuration

Import-ServyServiceConfig `
  -Quiet `
  -ConfigFileType "xml" `
  -Path "C:\WexflowServer.xml"

Import-ServyServiceConfig `
  -Quiet `
  -ConfigFileType "json" `
  -Path "C:\WexflowServer.json"

Start, Stop, Restart, and Check Status

Start-ServyService -Quiet -Name "WexflowServer"
Get-ServyServiceStatus -Quiet -Name "WexflowServer"
Stop-ServyService -Quiet -Name "WexflowServer"
Restart-ServyService -Quiet -Name "WexflowServer"

Uninstall a Service

Uninstall-ServyService -Quiet -Name "WexflowServer"

Cmdlets Reference

Cmdlet Parameters Description
Install-ServyService -Quiet (switch, optional)
-Name (string, required)
-Description (string, optional)
-Path (string, required)
-StartupDir (string, optional)
-Params (string, optional)
-StartupType (string, optional: Automatic, Manual, Disabled)
-ProcessPriority (string, optional: Idle, BelowNormal, Normal, AboveNormal, High, RealTime)
-StdoutPath (string, optional)
-StderrPath (string, optional)
-EnableRotation (switch, optional)
-RotationSize (int, optional)
-EnableHealth (switch, optional)
-HeartbeatInterval (int, optional)
-MaxFailedChecks (int, optional)
-RecoveryAction (string, optional: None, RestartService, RestartProcess, RestartComputer)
-MaxRestartAttempts (int, optional)
-FailureProgramPath (string, optional)
-FailureProgramStartupDir (string, optional)
-FailureProgramParams (string, optional)
-EnvironmentVariables (string, optional)
-ServiceDependencies (string, optional)
-User (string, optional)
-Password (string, optional)
-PreLaunchPath (string, optional)
-PreLaunchStartupDir (string, optional)
-PreLaunchParams (string, optional)
-PreLaunchEnv (string, optional)
-PreLaunchStdout (string, optional)
-PreLaunchStderr (string, optional)
-PreLaunchTimeout (int, optional)
-PreLaunchRetryAttempts (int, optional)
-PreLaunchIgnoreFailure (switch, optional)
-PostLaunchPath (string, optional)
-PostLaunchStartupDir (string, optional)
-PostLaunchParams (string, optional)
-EnableDebugLogs (switch, optional)
Installs a new Windows service with the specified parameters.
Uninstall-ServyService -Quiet (switch, optional)
-Name (string, required)
Uninstalls a Windows service by name.
Start-ServyService -Quiet (switch, optional)
-Name (string, required)
Starts a Windows service.
Stop-ServyService -Quiet (switch, optional)
-Name (string, required)
Stops a Windows service.
Restart-ServyService -Quiet (switch, optional)
-Name (string, required)
Restarts a Windows service.
Get-ServyServiceStatus -Quiet (switch, optional)
-Name (string, required)
Gets the current status of a Windows service. Possible results: Stopped, StartPending, StopPending, Running, ContinuePending, PausePending, Paused.
Export-ServyServiceConfig -Quiet (switch, optional)
-Name (string, required)
-ConfigFileType (string, required: xml, json)
-Path (string, required)
Exports the configuration of a service to a file (XML or JSON).
Import-ServyServiceConfig -Quiet (switch, optional)
-ConfigFileType (string, required: xml, json)
-Path (string, required)
Imports a service configuration from a file into Servy's database.
Show-ServyHelp -Quiet (switch, optional) Displays help information for all Servy CLI commands.
Show-ServyVersion -Quiet (switch, optional) Displays the current version of the Servy CLI module.

References

Clone this wiki locally