title: Parameter binding by name through pipeline when some values are empty
body: <p>In my module, I have two functions a 'Get-Data' and 'Add-Data' I'm having trouble passing information between them through the pipeline.</p>
  
  <p>The following simplified code shows my issue.</p>
  
  <pre><code>function Get-Data{
      param ($path)
      $out = Import-Csv $path
      Write-Output $out
  }
  </code></pre>
  
  <p>The data is the following, notice there are 'gaps' in the data and not every object has all three properties, in fact they cant.  You can only have Name and Color or Name and Fruit.  (In the real code there are many more properties)</p>
  
  <pre><code>Name,Color,Fruit
  Jim,red,
  Kate,,Apple
  Bob,green,
  Abby,,Banana
  </code></pre>
  
  <p>In the Add-Data function I want to use parameter sets as there are lots of parameters, but only 4 parameter sets possible (two in the simplified code, 'A' and 'B').  This function is exported from the module and I don't want the user to be able to input invalid parameter combinations.</p>
  
  <p>Here is the add-data function:</p>
  
  <pre><code>function Add-Data {
      [CmdletBinding()]
      Param (
          [Parameter(
              Position = 1,
              ValuefromPipelineByPropertyName = $true,
              Mandatory = $true
          )]
          [System.String]$Name,
  
          [Parameter(
              ParameterSetName = 'A',
              Position = 2,
              ValuefromPipelineByPropertyName = $true,
              Mandatory = $true
          )]
          [System.String]$Color,
  
          [Parameter(
              ParameterSetName = 'B',
              Position = 3,
              ValuefromPipelineByPropertyName = $true,
              Mandatory = $true
          )]
          [System.String]$Fruit
      )
      BEGIN{}
      PROCESS{
          Write-Output "$Name $Color $Fruit"
      }
      END{}
  }
  </code></pre>
  
  <p>When I pipe one to the other like below:</p>
  
  <pre><code>Get-Data -Path c:\some.csv | Add-Data
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Cannot bind argument to parameter 'Fruit' because it is an empty string
  </code></pre>
  
  <p>I know that I am passing an empty string to the fruit parameter and it's what is causing me the issue, but it's obviously not the behaviour I want.</p>
  
  <p>I'd like the fact that the property is empty to help resolve the parameter set so it only needs Name and Color.</p>
  
  <p>I can't use [AllowNull()] or [AllowEmptyString()] and remove the parameter sets as I expect users to use 'add-data' from the command line and I want 
      help add-data 
  to show them the correct params to enter.</p>
  
  <p>Thanks in advance for any help.</p>