Skip to content

Commit 929fa02

Browse files
StartAutomatingStartAutomating
authored andcommitted
Adding Inline Batch support (Fixes #198)
1 parent 0f08318 commit 929fa02

File tree

1 file changed

+87
-0
lines changed

1 file changed

+87
-0
lines changed

docs/Inline.Batch.md

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
2+
Inline.Batch
3+
------------
4+
### Synopsis
5+
Batch PipeScript Transpiler.
6+
7+
---
8+
### Description
9+
10+
Transpiles Windows Batch with Inline PipeScript into Batch Scripts.
11+
12+
Because Batch Scripts only allow single-line comments, this is done using a pair of comment markers.
13+
14+
15+
```batch
16+
:: {
17+
18+
Uncommented lines between these two points will be ignored
19+
20+
:: # Commented lines will become PipeScript / PowerShell.
21+
:: param($message = 'hello world')
22+
:: "echo $message"
23+
24+
:: }
25+
```
26+
27+
---
28+
### Examples
29+
#### EXAMPLE 1
30+
```PowerShell
31+
Invoke-PipeScript {
32+
$batchScript = '
33+
:: {
34+
```
35+
Uncommented lines between these two points will be ignored
36+
37+
:: # Commented lines will become PipeScript / PowerShell.
38+
:: param($message = "hello world")
39+
:: "echo $message"
40+
41+
:: }
42+
'
43+
44+
[OutputFile('.\HelloWorld.ps1.cmd')]$batchScript
45+
}
46+
47+
Invoke-PipeScript .\HelloWorld.ps1.cmd
48+
---
49+
### Parameters
50+
#### **CommandInfo**
51+
52+
The command information. This will include the path to the file.
53+
54+
55+
56+
|Type |Requried|Postion|PipelineInput |
57+
|-------------------|--------|-------|--------------|
58+
|```[CommandInfo]```|true |1 |true (ByValue)|
59+
---
60+
#### **Parameter**
61+
62+
A dictionary of parameters.
63+
64+
65+
66+
|Type |Requried|Postion|PipelineInput|
67+
|-------------------|--------|-------|-------------|
68+
|```[IDictionary]```|false |2 |false |
69+
---
70+
#### **ArgumentList**
71+
72+
A list of arguments.
73+
74+
75+
76+
|Type |Requried|Postion|PipelineInput|
77+
|------------------|--------|-------|-------------|
78+
|```[PSObject[]]```|false |3 |false |
79+
---
80+
### Syntax
81+
```PowerShell
82+
Inline.Batch [-CommandInfo] <CommandInfo> [[-Parameter] <IDictionary>] [[-ArgumentList] <PSObject[]>] [<CommonParameters>]
83+
```
84+
---
85+
86+
87+

0 commit comments

Comments
 (0)