-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
task.json
261 lines (261 loc) · 9.08 KB
/
task.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
{
"id": "E213FF0F-5D5C-4791-802D-52EA3E7BE1F1",
"name": "PowerShell",
"friendlyName": "PowerShell",
"description": "Run a PowerShell script on Linux, macOS, or Windows",
"helpUrl": "https://docs.microsoft.com/azure/devops/pipelines/tasks/utility/powershell",
"helpMarkDown": "[Learn more about this task](https://go.microsoft.com/fwlink/?LinkID=613736)",
"category": "Utility",
"visibility": [
"Build",
"Release"
],
"runsOn": [
"Agent",
"DeploymentGroup"
],
"author": "Microsoft Corporation",
"version": {
"Major": 2,
"Minor": 245,
"Patch": 0
},
"releaseNotes": "Script task consistency. Added support for macOS and Linux.",
"minimumAgentVersion": "2.115.0",
"showEnvironmentVariables": true,
"groups": [
{
"name": "preferenceVariables",
"displayName": "Preference Variables",
"isExpanded": false
},
{
"name": "advanced",
"displayName": "Advanced",
"isExpanded": false
}
],
"inputs": [
{
"name": "targetType",
"type": "radio",
"label": "Type",
"required": false,
"defaultValue": "filePath",
"helpMarkDown": "Target script type: File Path or Inline",
"options": {
"filePath": "File Path",
"inline": "Inline"
}
},
{
"name": "filePath",
"type": "filePath",
"label": "Script Path",
"visibleRule": "targetType = filePath",
"required": true,
"defaultValue": "",
"helpMarkDown": "Path of the script to execute. Must be a fully qualified path or relative to $(System.DefaultWorkingDirectory)."
},
{
"name": "arguments",
"type": "string",
"label": "Arguments",
"visibleRule": "targetType = filePath",
"required": false,
"defaultValue": "",
"helpMarkDown": "Arguments passed to the PowerShell script. Either ordinal parameters or named parameters."
},
{
"name": "script",
"type": "multiLine",
"label": "Script",
"visibleRule": "targetType = inline",
"required": true,
"defaultValue": "# Write your PowerShell commands here.\n\nWrite-Host \"Hello World\"\n",
"properties": {
"resizable": "true",
"rows": "10",
"maxLength": "20000"
},
"helpMarkDown": ""
},
{
"name": "errorActionPreference",
"type": "pickList",
"label": "ErrorActionPreference",
"required": false,
"defaultValue": "stop",
"options": {
"default": "Default",
"stop": "Stop",
"continue": "Continue",
"silentlyContinue": "SilentlyContinue"
},
"helpMarkDown": "When not `Default`, prepends the line `$ErrorActionPreference = 'VALUE'` at the top of your script.",
"groupName": "preferenceVariables"
},
{
"name": "warningPreference",
"type": "pickList",
"label": "WarningPreference",
"required": false,
"defaultValue": "default",
"options": {
"default": "Default",
"stop": "Stop",
"continue": "Continue",
"silentlyContinue": "SilentlyContinue"
},
"helpMarkDown": "When not `Default`, prepends the line `$WarningPreference = 'VALUE'` at the top of your script.",
"groupName": "preferenceVariables"
},
{
"name": "informationPreference",
"type": "pickList",
"label": "InformationPreference",
"required": false,
"defaultValue": "default",
"options": {
"default": "Default",
"stop": "Stop",
"continue": "Continue",
"silentlyContinue": "SilentlyContinue"
},
"helpMarkDown": "When not `Default`, prepends the line `$InformationPreference = 'VALUE'` at the top of your script.",
"groupName": "preferenceVariables"
},
{
"name": "verbosePreference",
"type": "pickList",
"label": "VerbosePreference",
"required": false,
"defaultValue": "default",
"options": {
"default": "Default",
"stop": "Stop",
"continue": "Continue",
"silentlyContinue": "SilentlyContinue"
},
"helpMarkDown": "When not `Default`, prepends the line `$VerbosePreference = 'VALUE'` at the top of your script.",
"groupName": "preferenceVariables"
},
{
"name": "debugPreference",
"type": "pickList",
"label": "DebugPreference",
"required": false,
"defaultValue": "default",
"options": {
"default": "Default",
"stop": "Stop",
"continue": "Continue",
"silentlyContinue": "SilentlyContinue"
},
"helpMarkDown": "When not `Default`, prepends the line `$DebugPreference = 'VALUE'` at the top of your script.",
"groupName": "preferenceVariables"
},
{
"name": "progressPreference",
"type": "pickList",
"label": "ProgressPreference",
"required": false,
"defaultValue": "silentlyContinue",
"options": {
"default": "Default",
"stop": "Stop",
"continue": "Continue",
"silentlyContinue": "SilentlyContinue"
},
"helpMarkDown": "When not `Default`, prepends the line `$ProgressPreference = 'VALUE'` at the top of your script.",
"groupName": "preferenceVariables"
},
{
"name": "failOnStderr",
"type": "boolean",
"label": "Fail on Standard Error",
"required": false,
"defaultValue": "false",
"helpMarkDown": "If this is true, this task will fail if any errors are written to the error pipeline, or if any data is written to the Standard Error stream. Otherwise the task will rely on the exit code to determine failure.",
"groupName": "advanced"
},
{
"name": "showWarnings",
"type": "boolean",
"label": "Show warnings as Azure DevOps warnings",
"required": false,
"defaultValue": "false",
"helpMarkDown": "If this is true, and your script writes a warnings - they are shown as warnings also in pipeline logs",
"groupName": "advanced"
},
{
"name": "ignoreLASTEXITCODE",
"type": "boolean",
"label": "Ignore $LASTEXITCODE",
"required": false,
"defaultValue": "false",
"helpMarkDown": "If this is false, the line `if ((Test-Path -LiteralPath variable:\\LASTEXITCODE)) { exit $LASTEXITCODE }` is appended to the end of your script. This will cause the last exit code from an external command to be propagated as the exit code of powershell. Otherwise the line is not appended to the end of your script.",
"groupName": "advanced"
},
{
"name": "pwsh",
"type": "boolean",
"label": "Use PowerShell Core",
"required": false,
"defaultValue": "false",
"helpMarkDown": "If this is true, then on Windows the task will use pwsh.exe from your PATH instead of powershell.exe.",
"groupName": "advanced"
},
{
"name": "workingDirectory",
"type": "filePath",
"label": "Working Directory",
"required": false,
"defaultValue": "",
"helpMarkDown": "Working directory where the script is run.",
"groupName": "advanced"
},
{
"name": "runScriptInSeparateScope",
"type": "boolean",
"label": "Run script in the separate scope",
"required": false,
"defaultValue": "false",
"helpMarkDown": "This input allows executing PowerShell scripts using '&' operator instead of the default '.'. If this input set to the true script will be executed in separate scope and globally scoped PowerShell variables won't be updated",
"groupName": "advanced"
}
],
"instanceNameFormat": "PowerShell Script",
"execution": {
"PowerShell3": {
"target": "powershell.ps1",
"platforms": [
"windows"
]
},
"Node10": {
"target": "powershell.js",
"argumentFormat": ""
},
"Node16": {
"target": "powershell.js",
"argumentFormat": ""
}
},
"messages": {
"GeneratingScript": "Generating script.",
"JS_ExitCode": "PowerShell exited with code '%s'.",
"JS_FormattedCommand": "Formatted command: %s",
"JS_InvalidActionPreference": "Invalid action preference for %s: '%s'. The value must be one of: %s",
"JS_InvalidFilePath": "Invalid file path '%s'. A path to a .ps1 file is required.",
"JS_Stderr": "PowerShell wrote one or more lines to the standard error stream.",
"JS_InvalidTargetType": "Invalid target type '%s'. The value must be one of: 'filepath' or 'inline'",
"PS_ExitCode": "PowerShell exited with code '{0}'.",
"PS_FormattedCommand": "Formatted command: {0}",
"PS_InvalidActionPreference": "Invalid action preference for {0}: '{1}'. The value must be one of: {2}",
"PS_InvalidFilePath": "Invalid file path '{0}'. A path to a .ps1 file is required.",
"PS_UnableToDetermineExitCode": "Unexpected exception. Unable to determine the exit code from powershell.",
"PS_InvalidTargetType": "Invalid target type '{0}'. The value must be one of: 'filepath' or 'inline'",
"ScriptArgsSanitized": "Detected characters in arguments that may not be executed correctly by the shell. Please escape special characters using backtick (`). More information is available here: https://aka.ms/ado/75787"
}
}