Can someone please point me to a resource that can tell me how to pass in a Object[]
as a parameter within a powershell function? Both of these functions are Cmdlets and they are being exported correctly, but I cannot see the $Return
object in my second function.
Is something like this needed? https://msdn.microsoft.com/en-us/library/system.management.automation.parameterattribute.valuefrompipeline(v=vs.85).aspx
# Within powershell code
$Return = My-Function -Param "value" # $Return is of type Object[]
$ModifiedReturn = My-SecondFunction -Input $Return
Where this is my function definiton
function My-SecondFunction
{
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True)]
[Object[]]$Input
)
begin {}
process
{
Write-Host "test: $Input" # does not return anything
}
end {}
}