TestimoX

API Reference

Command

Install-CxService

Namespace ComputerX.PowerShell
Outputs
ComputerX.Services.WindowsServiceStatusSnapshot

Implements the Install-CxService cmdlet.

Examples

Authored help example

Example 1


Install-CxService -Name TestimoX.Agent -DisplayName 'TestimoX Agent' -ExecutablePath C:\Program Files\TestimoX\TestimoX.Agent.exe -Argument '--config','C:\ProgramData\TestimoX\TestimoX.Agent.json'
        

Example 2


Install-CxService -Name TestimoX.Monitoring -DisplayName 'TestimoX Monitoring' -ExecutablePath C:\ProgramData\TestimoX\Monitoring\TestimoX.Monitoring.exe -Ensure -DelayedAutoStart
        

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.

Syntax

Install-CxService -Name <string> -DisplayName <string> [-ComputerName <string>] -ExecutablePath <string> [-Argument <string[]>] -Ensure [-AccountName <string>] [-DelayedAutoStart] [-Dependency <string[]>] [-Description <string>] [-ErrorControl <Ignore|Normal|Severe|Critical>] [-FirstFailureDelayMs <int>] [-NoStart] [-Password <string>] [-RecoveryOptions <WindowsServiceRecoveryOptions>] [-ResetPeriodSeconds <int>] [-SecondFailureDelayMs <int>] [-ServiceType <Unknown>] [-StartMode <Boot|System|Automatic|Manual|Disabled>] [-SubsequentFailureDelayMs <int>] [<CommonParameters>]
#
Parameter set: By Ensure

Parameters

Name string requiredposition: 0pipeline: falsealiases: ServiceName
Gets or sets the Windows service name.
DisplayName string requiredposition: 1pipeline: false
Gets or sets the display name shown in the Services console.
ComputerName string optionalposition: 2pipeline: false
Gets or sets the target computer name.
ExecutablePath string requiredposition: 3pipeline: false
Gets or sets the service executable path.
Argument string[] optionalposition: 4pipeline: falsealiases: Arguments
Gets or sets optional command-line arguments appended after the executable path.
Ensure SwitchParameter requiredposition: namedpipeline: false
Gets or sets a value indicating whether the service should be created when missing or updated when present.
AccountName string optionalposition: namedpipeline: false
Gets or sets the service account name.
DelayedAutoStart SwitchParameter optionalposition: namedpipeline: false
Gets or sets a value indicating whether delayed automatic start is enabled.
Dependency string[] optionalposition: namedpipeline: falsealiases: Dependencies
Gets or sets optional service dependencies.
Description string optionalposition: namedpipeline: false
Gets or sets an optional service description.
ErrorControl WindowsServiceErrorControl optionalposition: namedpipeline: falsevalues: 4
Gets or sets the service error control policy. Possible values: Ignore, Normal, Severe, Critical
Possible values: Ignore, Normal, Severe, Critical
FirstFailureDelayMs int optionalposition: namedpipeline: false
Gets or sets the delay in milliseconds before the first restart action.
NoStart SwitchParameter optionalposition: namedpipeline: false
Gets or sets a value indicating whether the service should not be started after install or update.
Password string optionalposition: namedpipeline: false
Gets or sets the password for the configured service account.
RecoveryOptions WindowsServiceRecoveryOptions optionalposition: namedpipeline: false
Gets or sets optional recovery options to apply during installation or update.
ResetPeriodSeconds int optionalposition: namedpipeline: false
Gets or sets the recovery reset period in seconds for restart-only convenience setup.
SecondFailureDelayMs int optionalposition: namedpipeline: false
Gets or sets the delay in milliseconds before the second restart action.
ServiceType WindowsServiceType optionalposition: namedpipeline: falsevalues: 9
Gets or sets the registered service type. Possible values: Unknown, KernelDriver, FileSystemDriver, Adapter, RecognizerDriver, Win32OwnProcess, Win32ShareProcess, UserOwnProcess, UserShareProcess
Possible values: Unknown, KernelDriver, FileSystemDriver, Adapter, RecognizerDriver, Win32OwnProcess, Win32ShareProcess, UserOwnProcess, UserShareProcess
StartMode ServiceStartMode optionalposition: namedpipeline: falsevalues: 5
Gets or sets the startup mode applied to the service. Possible values: Boot, System, Automatic, Manual, Disabled
Possible values: Boot, System, Automatic, Manual, Disabled
SubsequentFailureDelayMs int optionalposition: namedpipeline: false
Gets or sets the delay in milliseconds before the third and later restart actions.

Outputs

ComputerX.Services.WindowsServiceStatusSnapshot

Install-CxService -Name <string> -DisplayName <string> [-ComputerName <string>] -ExecutablePath <string> [-Argument <string[]>] -UpdateExisting [-AccountName <string>] [-DelayedAutoStart] [-Dependency <string[]>] [-Description <string>] [-ErrorControl <Ignore|Normal|Severe|Critical>] [-FirstFailureDelayMs <int>] [-NoStart] [-Password <string>] [-RecoveryOptions <WindowsServiceRecoveryOptions>] [-ResetPeriodSeconds <int>] [-SecondFailureDelayMs <int>] [-ServiceType <Unknown>] [-StartMode <Boot|System|Automatic|Manual|Disabled>] [-SubsequentFailureDelayMs <int>] [<CommonParameters>]
#
Parameter set: By UpdateExisting

Parameters

Name string requiredposition: 0pipeline: falsealiases: ServiceName
Gets or sets the Windows service name.
DisplayName string requiredposition: 1pipeline: false
Gets or sets the display name shown in the Services console.
ComputerName string optionalposition: 2pipeline: false
Gets or sets the target computer name.
ExecutablePath string requiredposition: 3pipeline: false
Gets or sets the service executable path.
Argument string[] optionalposition: 4pipeline: falsealiases: Arguments
Gets or sets optional command-line arguments appended after the executable path.
UpdateExisting SwitchParameter requiredposition: namedpipeline: false
Gets or sets a value indicating whether only an existing service should be updated.
AccountName string optionalposition: namedpipeline: false
Gets or sets the service account name.
DelayedAutoStart SwitchParameter optionalposition: namedpipeline: false
Gets or sets a value indicating whether delayed automatic start is enabled.
Dependency string[] optionalposition: namedpipeline: falsealiases: Dependencies
Gets or sets optional service dependencies.
Description string optionalposition: namedpipeline: false
Gets or sets an optional service description.
ErrorControl WindowsServiceErrorControl optionalposition: namedpipeline: falsevalues: 4
Gets or sets the service error control policy. Possible values: Ignore, Normal, Severe, Critical
Possible values: Ignore, Normal, Severe, Critical
FirstFailureDelayMs int optionalposition: namedpipeline: false
Gets or sets the delay in milliseconds before the first restart action.
NoStart SwitchParameter optionalposition: namedpipeline: false
Gets or sets a value indicating whether the service should not be started after install or update.
Password string optionalposition: namedpipeline: false
Gets or sets the password for the configured service account.
RecoveryOptions WindowsServiceRecoveryOptions optionalposition: namedpipeline: false
Gets or sets optional recovery options to apply during installation or update.
ResetPeriodSeconds int optionalposition: namedpipeline: false
Gets or sets the recovery reset period in seconds for restart-only convenience setup.
SecondFailureDelayMs int optionalposition: namedpipeline: false
Gets or sets the delay in milliseconds before the second restart action.
ServiceType WindowsServiceType optionalposition: namedpipeline: falsevalues: 9
Gets or sets the registered service type. Possible values: Unknown, KernelDriver, FileSystemDriver, Adapter, RecognizerDriver, Win32OwnProcess, Win32ShareProcess, UserOwnProcess, UserShareProcess
Possible values: Unknown, KernelDriver, FileSystemDriver, Adapter, RecognizerDriver, Win32OwnProcess, Win32ShareProcess, UserOwnProcess, UserShareProcess
StartMode ServiceStartMode optionalposition: namedpipeline: falsevalues: 5
Gets or sets the startup mode applied to the service. Possible values: Boot, System, Automatic, Manual, Disabled
Possible values: Boot, System, Automatic, Manual, Disabled
SubsequentFailureDelayMs int optionalposition: namedpipeline: false
Gets or sets the delay in milliseconds before the third and later restart actions.

Outputs

ComputerX.Services.WindowsServiceStatusSnapshot