Makes Output from a PowerShell function Explicit.
Makes a PowerShell function explicitly output.
All statements will be assigned to $null, unless they explicitly use Write-Output or echo.
If Write-Output or echo is used, the command will be replaced for more effecient output.
EXAMPLE 1
Invoke-PipeScript {
[explicit()]
param()
"This Will Not Output"
Write-Output "This Will Output"
}EXAMPLE 2
{
[explicit]{
1,2,3,4
echo "Output"
}
} | .>PipeScriptThe ScriptBlock that will be transpiled.
| Type | Required | Position | PipelineInput |
|---|---|---|---|
[ScriptBlock] |
true | 1 | true (ByValue) |
Explicit [-ScriptBlock] <ScriptBlock> [<CommonParameters>]