Skip to content

Commit c1e6999

Browse files
author
James Brundage
committed
Merge branch 'PipeScriptEnhancements' of https://github.com/StartAutomating/PipeScript into PipeScriptEnhancements
2 parents 504eb1a + 3edc943 commit c1e6999

File tree

4 files changed

+135
-1
lines changed

4 files changed

+135
-1
lines changed

Transpilers/Parameters/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ When this is the case it is common for the transpiler to add a ```[ValidateScrip
1818
|DisplayName |Synopsis |
1919
|----------------------------------------------------|---------------------------------------------------------------------|
2020
|[Aliases](Aliases.psx.ps1) |[Dynamically Defines Aliases](Aliases.psx.ps1) |
21+
|[RemoveParameter](RemoveParameter.psx.ps1) |[Removes Parameters from a ScriptBlock](RemoveParameter.psx.ps1) |
2122
|[ValidateExtension](ValidateExtension.psx.ps1) |[Validates Extensions](ValidateExtension.psx.ps1) |
2223
|[ValidatePlatform](ValidatePlatform.psx.ps1) |[Validates the Platform](ValidatePlatform.psx.ps1) |
2324
|[ValidatePropertyName](ValidatePropertyName.psx.ps1)|[Validates Property Names](ValidatePropertyName.psx.ps1) |

docs/New-PipeScript.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,31 @@ The script header.
8282
|--------------|--------|-------|---------------------|
8383
|```[String]```|false |6 |true (ByPropertyName)|
8484
---
85+
#### **AutoParameter**
86+
87+
If provided, will automatically create parameters.
88+
Parameters will be automatically created for any unassigned variables.
89+
90+
91+
92+
|Type |Requried|Postion|PipelineInput|
93+
|--------------|--------|-------|-------------|
94+
|```[Switch]```|false |named |false |
95+
---
96+
#### **AutoParameterType**
97+
98+
The type used for automatically generated parameters.
99+
By default, ```[PSObject]```.
100+
101+
102+
103+
|Type |Requried|Postion|PipelineInput|
104+
|------------|--------|-------|-------------|
105+
|```[Type]```|false |7 |false |
106+
---
85107
### Syntax
86108
```PowerShell
87-
New-PipeScript [[-Parameter] <Object>] [[-DynamicParameter] <ScriptBlock>] [[-Begin] <ScriptBlock>] [[-Process] <ScriptBlock>] [[-End] <ScriptBlock>] [[-Header] <String>] [<CommonParameters>]
109+
New-PipeScript [[-Parameter] <Object>] [[-DynamicParameter] <ScriptBlock>] [[-Begin] <ScriptBlock>] [[-Process] <ScriptBlock>] [[-End] <ScriptBlock>] [[-Header] <String>] [-AutoParameter] [[-AutoParameterType] <Type>] [<CommonParameters>]
88110
```
89111
---
90112

docs/RemoveParameter.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
RemoveParameter
3+
---------------
4+
### Synopsis
5+
Removes Parameters from a ScriptBlock
6+
7+
---
8+
### Description
9+
10+
Removes Parameters from a ScriptBlock
11+
12+
---
13+
### Related Links
14+
* [Update-PipeScript](Update-PipeScript.md)
15+
---
16+
### Examples
17+
#### EXAMPLE 1
18+
```PowerShell
19+
{
20+
[RemoveParameter("x")]
21+
param($x, $y)
22+
} | .>PipeScript
23+
```
24+
25+
---
26+
### Parameters
27+
#### **ParameterName**
28+
29+
The name of one or more parameters to remove
30+
31+
32+
33+
|Type |Requried|Postion|PipelineInput|
34+
|----------------|--------|-------|-------------|
35+
|```[String[]]```|true |1 |false |
36+
---
37+
#### **ScriptBlock**
38+
39+
The ScriptBlock that declares the parameters.
40+
41+
42+
43+
|Type |Requried|Postion|PipelineInput |
44+
|-------------------|--------|-------|--------------|
45+
|```[ScriptBlock]```|true |named |true (ByValue)|
46+
---
47+
### Syntax
48+
```PowerShell
49+
RemoveParameter [-ParameterName] <String[]> -ScriptBlock <ScriptBlock> [<CommonParameters>]
50+
```
51+
---
52+
53+

docs/RenameVariable.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
RenameVariable
3+
--------------
4+
### Synopsis
5+
Renames variables
6+
7+
---
8+
### Description
9+
10+
Renames variables in a ScriptBlock
11+
12+
---
13+
### Related Links
14+
* [Update-PipeScript](Update-PipeScript.md)
15+
---
16+
### Examples
17+
#### EXAMPLE 1
18+
```PowerShell
19+
{
20+
[RenameVariable(VariableRename={
21+
@{
22+
x='x1'
23+
y='y1'
24+
}
25+
})]
26+
param($x, $y)
27+
} | .>PipeScript
28+
```
29+
30+
---
31+
### Parameters
32+
#### **VariableRename**
33+
34+
The name of one or more parameters to remove
35+
36+
37+
38+
|Type |Requried|Postion|PipelineInput|
39+
|-------------------|--------|-------|-------------|
40+
|```[IDictionary]```|true |1 |false |
41+
---
42+
#### **ScriptBlock**
43+
44+
The ScriptBlock that declares the parameters.
45+
46+
47+
48+
|Type |Requried|Postion|PipelineInput |
49+
|-------------------|--------|-------|--------------|
50+
|```[ScriptBlock]```|true |named |true (ByValue)|
51+
---
52+
### Syntax
53+
```PowerShell
54+
RenameVariable [-VariableRename] <IDictionary> -ScriptBlock <ScriptBlock> [<CommonParameters>]
55+
```
56+
---
57+
58+

0 commit comments

Comments
 (0)