title: PowerShell function ValueFromPipelineByPropertyName not using alias parameter name
body: <p>Trying to create a function that takes objects on the pipeline using the alias property. I'm not sure where this is going wrong.</p>
  
  <p>Example of the process:</p>
  
  <pre><code>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)"
  }
  </code></pre>
  
  <p>If I run this command:</p>
  
  <pre><code>Get-Aduser -filter {sn -eq 'smith'} -properties sn,givenname | Get-Name
  </code></pre>
  
  <p>the output looks like this:</p>
  
  <pre><code>firstName =  / string
  LastName  =   / string
  </code></pre>
  
  <p>The Function never seems to grab the sn and givenname attributes from the passed in object. What am I missing?</p>