/
windows-service-start.json
31 lines (31 loc) · 1.24 KB
/
windows-service-start.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{
"Id": "60733bf3-1617-4d85-a40f-4b6a0b9289ef",
"Name": "Windows Service - Start",
"Description": "Starts a Windows Service.",
"ActionType": "Octopus.Script",
"Version": 6,
"Properties": {
"Octopus.Action.Script.ScriptBody": "$serviceName = $OctopusParameters['ServiceName']\r\rWrite-Output \"Starting $serviceName...\"\r\r$serviceInstance = Get-Service $serviceName\rif ($serviceInstance.Status -eq \"Running\") {\r Write-Output \"The $serviceName service is already running.\"\r} else {\r start-service $serviceName\r $serviceInstance.WaitForStatus('Running', '00:01:00')\r Write-Output \"Started $serviceName\"\r}\r",
"Octopus.Action.Script.Syntax": "PowerShell"
},
"SensitiveProperties": {},
"Parameters": [
{
"Name": "ServiceName",
"Label": "Service Name",
"HelpText": "Name of the Windows Service (this is not always the display name).",
"DefaultValue": null,
"DisplaySettings": {
"Octopus.ControlType": "SingleLineText"
}
}
],
"LastModifiedOn": "2021-07-26T16:50:00.000+00:00",
"LastModifiedBy": "bobjwalker",
"$Meta": {
"ExportedAt": "2014-05-05T04:11:22.101+00:00",
"OctopusVersion": "2.4.2.1412",
"Type": "ActionTemplate"
},
"Category": "windows"
}