I am creating PowerShell cmdlets in C# by extending the PSCmdlet class. I need to get the entire Pipelined input to use in the C# code. I tried having a parameter with properties set as:
[Parameter(Mandatory = true, ValueFromPipeline = true, ValueFromPipelineByPropertyName = true)]
public Object Connection;
When I try to execute the cmdlet by piping in a list of items, I get one item at a time to process in the C# code.
$a=@("value1","value2")
$a | cmdlet-name
I need to get the entire piped input to process in my C# code. I found that this can be obtained in PowerShell using the $input variable. Is there a C# equivalent of this $input PowerShell variable?