Skip to content

Commit 65c8847

Browse files
author
James Brundage
committed
Adding RemoveParameter transpiler (#159)
1 parent 2dbc6a8 commit 65c8847

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<#
2+
.SYNOPSIS
3+
Removes Parameters from a ScriptBlock
4+
.DESCRIPTION
5+
Removes Parameters from a ScriptBlock
6+
.EXAMPLE
7+
{
8+
[RemoveParameter("x")]
9+
param($x, $y)
10+
} | .>PipeScript
11+
.LINK
12+
Update-PipeScript
13+
#>
14+
param(
15+
# The name of one or more parameters to remove
16+
[Parameter(Mandatory,Position=0)]
17+
[string[]]
18+
$ParameterName,
19+
20+
# The ScriptBlock that declares the parameters.
21+
[Parameter(Mandatory,ValueFromPipeline)]
22+
[scriptblock]
23+
$ScriptBlock
24+
)
25+
26+
process {
27+
Update-PipeScript -ScriptBlock $ScriptBlock -RemoveParameter $ParameterName
28+
}

0 commit comments

Comments
 (0)