API Reference
Command
Install-CxService
Implements the Install-CxService cmdlet.
Examples
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 EnsureParameters
- Name string
- Gets or sets the Windows service name.
- DisplayName string
- Gets or sets the display name shown in the Services console.
- ComputerName string
- Gets or sets the target computer name.
- ExecutablePath string
- Gets or sets the service executable path.
- Argument string[]
- Gets or sets optional command-line arguments appended after the executable path.
- Ensure SwitchParameter
- Gets or sets a value indicating whether the service should be created when missing or updated when present.
- AccountName string
- Gets or sets the service account name.
- DelayedAutoStart SwitchParameter
- Gets or sets a value indicating whether delayed automatic start is enabled.
- Dependency string[]
- Gets or sets optional service dependencies.
- Description string
- Gets or sets an optional service description.
- ErrorControl WindowsServiceErrorControl
- Gets or sets the service error control policy. Possible values: Ignore, Normal, Severe, Critical
- Possible values:
Ignore,Normal,Severe,Critical - FirstFailureDelayMs int
- Gets or sets the delay in milliseconds before the first restart action.
- NoStart SwitchParameter
- Gets or sets a value indicating whether the service should not be started after install or update.
- Password string
- Gets or sets the password for the configured service account.
- RecoveryOptions WindowsServiceRecoveryOptions
- Gets or sets optional recovery options to apply during installation or update.
- ResetPeriodSeconds int
- Gets or sets the recovery reset period in seconds for restart-only convenience setup.
- SecondFailureDelayMs int
- Gets or sets the delay in milliseconds before the second restart action.
- ServiceType WindowsServiceType
- 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
- 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
- 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 UpdateExistingParameters
- Name string
- Gets or sets the Windows service name.
- DisplayName string
- Gets or sets the display name shown in the Services console.
- ComputerName string
- Gets or sets the target computer name.
- ExecutablePath string
- Gets or sets the service executable path.
- Argument string[]
- Gets or sets optional command-line arguments appended after the executable path.
- UpdateExisting SwitchParameter
- Gets or sets a value indicating whether only an existing service should be updated.
- AccountName string
- Gets or sets the service account name.
- DelayedAutoStart SwitchParameter
- Gets or sets a value indicating whether delayed automatic start is enabled.
- Dependency string[]
- Gets or sets optional service dependencies.
- Description string
- Gets or sets an optional service description.
- ErrorControl WindowsServiceErrorControl
- Gets or sets the service error control policy. Possible values: Ignore, Normal, Severe, Critical
- Possible values:
Ignore,Normal,Severe,Critical - FirstFailureDelayMs int
- Gets or sets the delay in milliseconds before the first restart action.
- NoStart SwitchParameter
- Gets or sets a value indicating whether the service should not be started after install or update.
- Password string
- Gets or sets the password for the configured service account.
- RecoveryOptions WindowsServiceRecoveryOptions
- Gets or sets optional recovery options to apply during installation or update.
- ResetPeriodSeconds int
- Gets or sets the recovery reset period in seconds for restart-only convenience setup.
- SecondFailureDelayMs int
- Gets or sets the delay in milliseconds before the second restart action.
- ServiceType WindowsServiceType
- 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
- 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
- Gets or sets the delay in milliseconds before the third and later restart actions.
Outputs
ComputerX.Services.WindowsServiceStatusSnapshot