Skip to content

Servy PowerShell Module

Akram El Assas edited this page Sep 16, 2025 · 113 revisions

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.

You can find detailed examples of how to use the Servy PowerShell module here.

Table of Contents

Installation

Import the module in your PowerShell session:

Import-Module .\Servy.psm1 -Force

Display the version:

Show-ServyVersion

Display help:

Show-ServyHelp

Usage Examples

Install a New Service

Install-ServyService `
  -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 `
  -Name "WexflowServer" `
  -ConfigFileType "xml" `
  -Path "C:\WexflowServer.xml"

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

Import Service Configuration

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

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

Start, Stop, Restart, and Check Status

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

Uninstall a Service

Uninstall-ServyService -Name "WexflowServer"

Cmdlets Reference

Cmdlet Parameters Description
Install-ServyService -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)-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) Installs a new Windows service with the specified parameters.
Uninstall-ServyService -Name (string, required) Uninstalls a Windows service by name.
Start-ServyService -Name (string, required) Starts a Windows service.
Stop-ServyService -Name (string, required) Stops a Windows service.
Restart-ServyService -Name (string, required) Restarts a Windows service.
Get-ServyServiceStatus -Name (string, required) Gets the current status of a Windows service. Possible results: Stopped, StartPending, StopPending, Running, ContinuePending, PausePending, Paused.
Export-ServyServiceConfig -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 -ConfigFileType (string, required: xml, json)-Path (string, required) Imports a service configuration from a file into Servy's database.
Show-ServyHelp (no parameters) Displays help information for all Servy CLI commands.
Show-ServyVersion (no parameters) Displays the current version of the Servy CLI module.

References

Clone this wiki locally