This is a very simple issue as far as I understand. There are plenty of similar questions on here, but I haven't been able to find exactly what I need. What am I missing?
Expected output
1 2 3
Actual output (error)
cmdlet ForEach-Object at command pipeline position 1
Supply values for the following parameters:
Process[0]:
Code
function processItem {
param($item)
Process {
$item
}
}
$collection = @(1,2,3)
$collection | foreach-object | processItem