PowerShell function ValueFromPipelineByPropertyName not using alias parameter name
Trying to create a function that takes objects on the pipeline using the alias property. I'm not sure where this is going wrong. Example of the process: function Get-Name { Param ( [Parameter(ValueFromPipelineByPropertyName=$true)] [alias("givenname")] [System.String] $FirstName, [Parameter(ValueFromPipelineByPropertyName=$true)] [alias("sn")] [System.String] $LastName ) write-host "firstName = $FirstName / $($FirstName.GetType().FullName)" Write-host "LastName = $LastName / $($LastName.GetType().FullName)" } If I run this command: Get-Aduser -filter {sn -eq 'smith'} -properties sn,givenname |