Beta_cartrigesg_bd Beta v0.8

This commit is contained in:
2026-07-26 15:54:16 +03:00
parent 7e6927eacc
commit 1576056624
3 changed files with 108 additions and 5 deletions

View File

@@ -0,0 +1,45 @@
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$ExecutablePath,
[Parameter(Mandatory = $true)]
[string]$WorkingDirectory
)
$ErrorActionPreference = 'Stop'
$taskName = 'Inventera Server'
if (-not (Split-Path -Parent $ExecutablePath)) {
throw 'The Inventera executable path is invalid.'
}
$action = New-ScheduledTaskAction `
-Execute $ExecutablePath `
-WorkingDirectory $WorkingDirectory
$trigger = New-ScheduledTaskTrigger -AtStartup
$settings = New-ScheduledTaskSettingsSet `
-StartWhenAvailable `
-RestartCount 5 `
-RestartInterval (New-TimeSpan -Minutes 1) `
-ExecutionTimeLimit ([TimeSpan]::Zero) `
-MultipleInstances IgnoreNew
$principal = New-ScheduledTaskPrincipal `
-UserId 'SYSTEM' `
-LogonType ServiceAccount `
-RunLevel Highest
$task = New-ScheduledTask `
-Action $action `
-Trigger $trigger `
-Settings $settings `
-Principal $principal `
-Description 'Starts the Inventera web server when Windows starts.'
Register-ScheduledTask `
-TaskName $taskName `
-InputObject $task `
-Force | Out-Null