title: Cannot bind argument to parameter 'Path' because it is an empty array
body: <p>This is my .CSV file:
  <a href="https://i.stack.imgur.com/ZXhDd.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZXhDd.jpg" alt="enter image description here"></a></p>
  
  <p>I use the following code to read the data from .CSV. Data read from the table will be converted into normal variable so that I can do some calculations.</p>
  
  <pre><code>$ScriptPath = Split-Path $MyInvocation.MyCommand.Path
  $TransportOptions = $ScriptPath + "\TransportOptions.csv"
  
  $TransportOptionsID = @()
  $TransportOptions = @()
  $TransportEnergy = @()
  $CO2 = @()
  
  Import-Csv $TransportOptions |`
  ForEach-Object {
      $TransportOptionsID += $_."TransportOptionsID"
      $TransportOptions += $_.TransportOptions
      $TransportEnergy += $_.TransportEnergy
      $CO2 += $_.CO2
  }
  
  $InputID = Read-Host -Prompt "TransportOptionsID"
  
  if ($TransportOptionsID -contains $InputID)
  {
      $Where = [array]::IndexOf($TransportOptionsID, $InputID)
      $InputName = $TransportOptions[$Where] 
  
      if ($TransportOptions -contains $InputName)
      {
          $Where = [array]::IndexOf($TransportOptions, $InputName)
          $InputEnergy = $TransportEnergy[$Where] 
          $HTransportEnergy = [double]$InputEnergy
  
          if ($TransportEnergy -contains $InputEnergy)
          {
              $Where = [array]::IndexOf($TransportEnergy, $InputEnergy)
              $CO2transport = [double]$CO2[$Where]
          }
      }
  }
  </code></pre>
  
  <p>But What I got is error:</p>
  
  <pre><code>ERROR: Import-Csv : Cannot bind argument to parameter 'Path' because it  is an empty array.
  ERROR:
  CO2estimatorUserInputs.ps1 (132, 11): ERROR: At Line: 132 char: 11
  ERROR: + Import-Csv &lt;&lt;&lt;&lt;  $TransportOptions |`
  ERROR:     + CategoryInfo          : InvalidData: (:) [Import-Csv], ParameterBindingValidationException
  ERROR:     + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyArrayNotAllowed,Microsoft.PowerShell.Commands.ImportCsvCommand
  ERROR:
  </code></pre>
  
  <p>Do I miss something in my code? Any idea to solve this error, please?</p>