1
1
Rest
2
2
----
3
+
4
+
5
+
6
+
3
7
### Synopsis
4
8
Generates PowerShell to talk to a REST api.
5
9
10
+
11
+
6
12
---
13
+
14
+
7
15
### Description
8
16
9
17
Generates PowerShell that communicates with a REST api.
10
18
19
+
20
+
11
21
---
22
+
23
+
12
24
### Examples
13
25
#### EXAMPLE 1
14
26
``` PowerShell
@@ -79,7 +91,11 @@ Invoke-PipeScript {
79
91
} | .>PipeScript
80
92
```
81
93
94
+
95
+
82
96
---
97
+
98
+
83
99
### Parameters
84
100
#### ** ScriptBlock**
85
101
@@ -88,137 +104,121 @@ If not empty, the contents of this ScriptBlock will preceed the REST api call.
88
104
89
105
90
106
91
- > ** Type** : ``` [ScriptBlock] ```
92
107
93
- > ** Required** : false
94
108
95
- > ** Position** : named
96
109
97
- > ** PipelineInput** : true (ByValue)
110
+ | Type | Required| Position| PipelineInput |
111
+ | ---------------| --------| --------| --------------|
112
+ | ` [ScriptBlock] ` | false | named | true (ByValue)|
98
113
99
114
100
115
101
- ---
102
116
#### ** RESTEndpoint**
103
117
104
118
One or more REST endpoints. This endpoint will be parsed for REST variables.
105
119
106
120
107
121
108
- > ** Type** : ``` [String[]] ```
109
122
110
- > ** Required** : true
111
123
112
- > ** Position** : 1
113
124
114
- > ** PipelineInput** : false
125
+ | Type | Required| Position| PipelineInput|
126
+ | ------------| --------| --------| -------------|
127
+ | ` [String[]] ` | true | 1 | false |
115
128
116
129
117
130
118
- ---
119
131
#### ** ContentType**
120
132
121
133
The content type. If provided, this parameter will be passed to the -InvokeCommand.
122
134
123
135
124
136
125
- > ** Type** : ``` [String] ```
126
137
127
- > ** Required** : false
128
138
129
- > ** Position** : named
130
139
131
- > ** PipelineInput** : false
140
+ | Type | Required| Position| PipelineInput|
141
+ | ----------| --------| --------| -------------|
142
+ | ` [String] ` | false | named | false |
132
143
133
144
134
145
135
- ---
136
146
#### ** Method**
137
147
138
148
The method. If provided, this parameter will be passed to the -InvokeCommand.
139
149
140
150
141
151
142
- > ** Type** : ``` [String] ```
143
152
144
- > ** Required** : false
145
153
146
- > ** Position** : named
147
154
148
- > ** PipelineInput** : false
155
+ | Type | Required| Position| PipelineInput|
156
+ | ----------| --------| --------| -------------|
157
+ | ` [String] ` | false | named | false |
149
158
150
159
151
160
152
- ---
153
161
#### ** InvokeCommand**
154
162
155
163
The invoke command. This command _ must_ have a parameter -URI.
156
164
157
165
158
166
159
- > ** Type** : ``` [String] ```
160
167
161
- > ** Required** : false
162
168
163
- > ** Position** : named
164
169
165
- > ** PipelineInput** : false
170
+ | Type | Required| Position| PipelineInput| Aliases|
171
+ | ----------| --------| --------| -------------| -------|
172
+ | ` [String] ` | false | named | false | Invoker|
166
173
167
174
168
175
169
- ---
170
176
#### ** InvokeParameterVariable**
171
177
172
178
The name of a variable containing additional invoke parameters.
173
179
By default, this is 'InvokeParams'
174
180
175
181
176
182
177
- > ** Type** : ``` [String] ```
178
183
179
- > ** Required** : false
180
184
181
- > ** Position** : named
182
185
183
- > ** PipelineInput** : false
186
+ | Type | Required| Position| PipelineInput| Aliases |
187
+ | ----------| --------| --------| -------------| --------------------------------------|
188
+ | ` [String] ` | false | named | false | InvokerParameters<br />InvokerParameter|
184
189
185
190
186
191
187
- ---
188
192
#### ** UriParameterHelp**
189
193
190
194
A dictionary of help for uri parameters.
191
195
192
196
193
197
194
- > ** Type** : ``` [IDictionary] ```
195
198
196
- > ** Required** : false
197
199
198
- > ** Position** : named
199
200
200
- > ** PipelineInput** : false
201
+ | Type | Required| Position| PipelineInput| Aliases |
202
+ | ---------------| --------| --------| -------------| ----------------|
203
+ | ` [IDictionary] ` | false | named | false | UrlParameterHelp|
201
204
202
205
203
206
204
- ---
205
207
#### ** UriParameterType**
206
208
207
209
A dictionary of URI parameter types.
208
210
209
211
210
212
211
- > ** Type** : ``` [IDictionary] ```
212
213
213
- > ** Required** : false
214
214
215
- > ** Position** : named
216
215
217
- > ** PipelineInput** : false
216
+ | Type | Required| Position| PipelineInput| Aliases |
217
+ | ---------------| --------| --------| -------------| ----------------|
218
+ | ` [IDictionary] ` | false | named | false | UrlParameterType|
218
219
219
220
220
221
221
- ---
222
222
#### ** BodyParameter**
223
223
224
224
A dictionary or list of parameters for the body.
@@ -238,17 +238,15 @@ If a parameter is a [switch], it will be turned into a [bool].
238
238
239
239
240
240
241
- > ** Type** : ``` [PSObject] ```
242
241
243
- > ** Required** : false
244
242
245
- > ** Position** : named
246
243
247
- > ** PipelineInput** : false
244
+ | Type | Required| Position| PipelineInput|
245
+ | ------------| --------| --------| -------------|
246
+ | ` [PSObject] ` | false | named | false |
248
247
249
248
250
249
251
- ---
252
250
#### ** QueryParameter**
253
251
254
252
A dictionary or list of query parameters.
@@ -268,55 +266,53 @@ If a parameter is a [switch], it will be turned into a [bool].
268
266
269
267
270
268
271
- > ** Type** : ``` [PSObject] ```
272
269
273
- > ** Required** : false
274
270
275
- > ** Position** : named
276
271
277
- > ** PipelineInput** : false
272
+ | Type | Required| Position| PipelineInput|
273
+ | ------------| --------| --------| -------------|
274
+ | ` [PSObject] ` | false | named | false |
278
275
279
276
280
277
281
- ---
282
278
#### ** JoinQueryValue**
283
279
284
280
If provided, will join multiple values of a query by this string.
285
281
If the string is '&', each value will be provided as a key-value pair.
286
282
287
283
288
284
289
- > ** Type** : ``` [String] ```
290
285
291
- > ** Required** : false
292
286
293
- > ** Position** : named
294
287
295
- > ** PipelineInput** : false
288
+ | Type | Required| Position| PipelineInput|
289
+ | ----------| --------| --------| -------------|
290
+ | ` [String] ` | false | named | false |
296
291
297
292
298
293
299
- ---
300
294
#### ** ForEachOutput**
301
295
302
296
A script block to be run on each output.
303
297
304
298
305
299
306
- > ** Type** : ``` [ScriptBlock] ```
307
300
308
- > ** Required** : false
309
301
310
- > ** Position** : named
311
302
312
- > ** PipelineInput** : false
303
+ | Type | Required| Position| PipelineInput|
304
+ | ---------------| --------| --------| -------------|
305
+ | ` [ScriptBlock] ` | false | named | false |
306
+
307
+
313
308
314
309
315
310
316
311
---
312
+
313
+
317
314
### Syntax
318
315
``` PowerShell
319
316
Rest [-ScriptBlock <ScriptBlock>] [-RESTEndpoint] <String[]> [-ContentType <String>] [-Method <String>] [-InvokeCommand <String>] [-InvokeParameterVariable <String>] [-UriParameterHelp <IDictionary>] [-UriParameterType <IDictionary>] [-BodyParameter <PSObject>] [-QueryParameter <PSObject>] [-JoinQueryValue <String>] [-ForEachOutput <ScriptBlock>] [<CommonParameters>]
320
317
```
321
- ---
322
318
0 commit comments