Skip to content

Commit 579406f

Browse files
StartAutomatingStartAutomating
authored andcommitted
Adding Support for PipeScript in Bash (Fixes #194)
1 parent 72fb93d commit 579406f

File tree

1 file changed

+78
-0
lines changed

1 file changed

+78
-0
lines changed

docs/Inline.Bash.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
2+
Inline.Bash
3+
-----------
4+
### Synopsis
5+
Bash PipeScript Transpiler.
6+
7+
---
8+
### Description
9+
10+
Transpiles Bash with Inline PipeScript into Bash.
11+
12+
Heredocs named PipeScript{} will be treated as blocks of PipeScript.
13+
14+
```bash
15+
<<PipeScript{}
16+
17+
# This will be considered PipeScript / PowerShell, and will return the contents of a bash script.
18+
19+
PipeScript{}
20+
```
21+
22+
---
23+
### Examples
24+
#### EXAMPLE 1
25+
```PowerShell
26+
Invoke-PipeScript {
27+
$bashScript = @'
28+
echo 'hello world'
29+
```
30+
<<PipeScript{}
31+
"echo '$('hi','yo','sup' | Get-Random)'"
32+
PipeScript{}
33+
'@
34+
35+
[OutputFile('.\HelloWorld.ps1.sh')]$bashScript
36+
}
37+
38+
Invoke-PipeScript .\HelloWorld.ps1.sh
39+
---
40+
### Parameters
41+
#### **CommandInfo**
42+
43+
The command information. This will include the path to the file.
44+
45+
46+
47+
|Type |Requried|Postion|PipelineInput |
48+
|-------------------|--------|-------|--------------|
49+
|```[CommandInfo]```|true |1 |true (ByValue)|
50+
---
51+
#### **Parameter**
52+
53+
A dictionary of parameters.
54+
55+
56+
57+
|Type |Requried|Postion|PipelineInput|
58+
|-------------------|--------|-------|-------------|
59+
|```[IDictionary]```|false |2 |false |
60+
---
61+
#### **ArgumentList**
62+
63+
A list of arguments.
64+
65+
66+
67+
|Type |Requried|Postion|PipelineInput|
68+
|------------------|--------|-------|-------------|
69+
|```[PSObject[]]```|false |3 |false |
70+
---
71+
### Syntax
72+
```PowerShell
73+
Inline.Bash [-CommandInfo] <CommandInfo> [[-Parameter] <IDictionary>] [[-ArgumentList] <PSObject[]>] [<CommonParameters>]
74+
```
75+
---
76+
77+
78+

0 commit comments

Comments
 (0)