Skip to content

Commit de96c03

Browse files
StartAutomatingStartAutomating
authored andcommitted
Join-PipeScript: Improving Unnamed end block behavior (Fixes #363)
1 parent a120b36 commit de96c03

File tree

1 file changed

+56
-60
lines changed

1 file changed

+56
-60
lines changed

docs/Rest.md

Lines changed: 56 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
Rest
22
----
3+
4+
5+
6+
37
### Synopsis
48
Generates PowerShell to talk to a REST api.
59

10+
11+
612
---
13+
14+
715
### Description
816

917
Generates PowerShell that communicates with a REST api.
1018

19+
20+
1121
---
22+
23+
1224
### Examples
1325
#### EXAMPLE 1
1426
```PowerShell
@@ -79,7 +91,11 @@ Invoke-PipeScript {
7991
} | .>PipeScript
8092
```
8193

94+
95+
8296
---
97+
98+
8399
### Parameters
84100
#### **ScriptBlock**
85101

@@ -88,137 +104,121 @@ If not empty, the contents of this ScriptBlock will preceed the REST api call.
88104

89105

90106

91-
> **Type**: ```[ScriptBlock]```
92107

93-
> **Required**: false
94108

95-
> **Position**: named
96109

97-
> **PipelineInput**:true (ByValue)
110+
|Type |Required|Position|PipelineInput |
111+
|---------------|--------|--------|--------------|
112+
|`[ScriptBlock]`|false |named |true (ByValue)|
98113

99114

100115

101-
---
102116
#### **RESTEndpoint**
103117

104118
One or more REST endpoints. This endpoint will be parsed for REST variables.
105119

106120

107121

108-
> **Type**: ```[String[]]```
109122

110-
> **Required**: true
111123

112-
> **Position**: 1
113124

114-
> **PipelineInput**:false
125+
|Type |Required|Position|PipelineInput|
126+
|------------|--------|--------|-------------|
127+
|`[String[]]`|true |1 |false |
115128

116129

117130

118-
---
119131
#### **ContentType**
120132

121133
The content type. If provided, this parameter will be passed to the -InvokeCommand.
122134

123135

124136

125-
> **Type**: ```[String]```
126137

127-
> **Required**: false
128138

129-
> **Position**: named
130139

131-
> **PipelineInput**:false
140+
|Type |Required|Position|PipelineInput|
141+
|----------|--------|--------|-------------|
142+
|`[String]`|false |named |false |
132143

133144

134145

135-
---
136146
#### **Method**
137147

138148
The method. If provided, this parameter will be passed to the -InvokeCommand.
139149

140150

141151

142-
> **Type**: ```[String]```
143152

144-
> **Required**: false
145153

146-
> **Position**: named
147154

148-
> **PipelineInput**:false
155+
|Type |Required|Position|PipelineInput|
156+
|----------|--------|--------|-------------|
157+
|`[String]`|false |named |false |
149158

150159

151160

152-
---
153161
#### **InvokeCommand**
154162

155163
The invoke command. This command _must_ have a parameter -URI.
156164

157165

158166

159-
> **Type**: ```[String]```
160167

161-
> **Required**: false
162168

163-
> **Position**: named
164169

165-
> **PipelineInput**:false
170+
|Type |Required|Position|PipelineInput|Aliases|
171+
|----------|--------|--------|-------------|-------|
172+
|`[String]`|false |named |false |Invoker|
166173

167174

168175

169-
---
170176
#### **InvokeParameterVariable**
171177

172178
The name of a variable containing additional invoke parameters.
173179
By default, this is 'InvokeParams'
174180

175181

176182

177-
> **Type**: ```[String]```
178183

179-
> **Required**: false
180184

181-
> **Position**: named
182185

183-
> **PipelineInput**:false
186+
|Type |Required|Position|PipelineInput|Aliases |
187+
|----------|--------|--------|-------------|--------------------------------------|
188+
|`[String]`|false |named |false |InvokerParameters<br/>InvokerParameter|
184189

185190

186191

187-
---
188192
#### **UriParameterHelp**
189193

190194
A dictionary of help for uri parameters.
191195

192196

193197

194-
> **Type**: ```[IDictionary]```
195198

196-
> **Required**: false
197199

198-
> **Position**: named
199200

200-
> **PipelineInput**:false
201+
|Type |Required|Position|PipelineInput|Aliases |
202+
|---------------|--------|--------|-------------|----------------|
203+
|`[IDictionary]`|false |named |false |UrlParameterHelp|
201204

202205

203206

204-
---
205207
#### **UriParameterType**
206208

207209
A dictionary of URI parameter types.
208210

209211

210212

211-
> **Type**: ```[IDictionary]```
212213

213-
> **Required**: false
214214

215-
> **Position**: named
216215

217-
> **PipelineInput**:false
216+
|Type |Required|Position|PipelineInput|Aliases |
217+
|---------------|--------|--------|-------------|----------------|
218+
|`[IDictionary]`|false |named |false |UrlParameterType|
218219

219220

220221

221-
---
222222
#### **BodyParameter**
223223

224224
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].
238238

239239

240240

241-
> **Type**: ```[PSObject]```
242241

243-
> **Required**: false
244242

245-
> **Position**: named
246243

247-
> **PipelineInput**:false
244+
|Type |Required|Position|PipelineInput|
245+
|------------|--------|--------|-------------|
246+
|`[PSObject]`|false |named |false |
248247

249248

250249

251-
---
252250
#### **QueryParameter**
253251

254252
A dictionary or list of query parameters.
@@ -268,55 +266,53 @@ If a parameter is a [switch], it will be turned into a [bool].
268266

269267

270268

271-
> **Type**: ```[PSObject]```
272269

273-
> **Required**: false
274270

275-
> **Position**: named
276271

277-
> **PipelineInput**:false
272+
|Type |Required|Position|PipelineInput|
273+
|------------|--------|--------|-------------|
274+
|`[PSObject]`|false |named |false |
278275

279276

280277

281-
---
282278
#### **JoinQueryValue**
283279

284280
If provided, will join multiple values of a query by this string.
285281
If the string is '&', each value will be provided as a key-value pair.
286282

287283

288284

289-
> **Type**: ```[String]```
290285

291-
> **Required**: false
292286

293-
> **Position**: named
294287

295-
> **PipelineInput**:false
288+
|Type |Required|Position|PipelineInput|
289+
|----------|--------|--------|-------------|
290+
|`[String]`|false |named |false |
296291

297292

298293

299-
---
300294
#### **ForEachOutput**
301295

302296
A script block to be run on each output.
303297

304298

305299

306-
> **Type**: ```[ScriptBlock]```
307300

308-
> **Required**: false
309301

310-
> **Position**: named
311302

312-
> **PipelineInput**:false
303+
|Type |Required|Position|PipelineInput|
304+
|---------------|--------|--------|-------------|
305+
|`[ScriptBlock]`|false |named |false |
306+
307+
313308

314309

315310

316311
---
312+
313+
317314
### Syntax
318315
```PowerShell
319316
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>]
320317
```
321-
---
322318

0 commit comments

Comments
 (0)