Relative Content

Tag Archive for powershellparameter-passingpipelineforeach-object

Difference between pipeline ForEach-Object and -InputObject [duplicate]

This question already has an answer here: Powershell Where-Object doesn’t seem to filter (1 answer) Closed last month. I assume this has something to do with how the data is passed via the pipeline, but take the two examples below; $someData = Get-ChildItem $obj = ForEach-Object -InputObject $someData -Process {[pscustomobject] @{Name=$_.Name; LastWriteTime = $_.LastWriteTime}} $obj2 […]