I'm trying to do what I thuink should be a simple thing but it's just not working. I wrote a sample function and I'm passing an object and then referencing the properties of it. But the output only shows the object name twice, not the properties I want.
Shouldn't this work?
function test-passing { [CmdletBinding(SupportsShouldProcess=$true)] param( [parameter( Position=0, Mandatory=$true, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$true)] $Length, [parameter( Position=1, Mandatory=$true, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$true)] $LastWriteTime ) process{ Write-Host $LastWriteTime Write-Host $Length } } Get-ChildItem | test-passing