title: Positional parameter cannot be found error in powershell
body: <p>I am trying to append the date to a file name in my Powershell script but keep getting the following error (my code is below the error).  Any help/direction would be greatly appreciated.  Thank you.</p>
  
  <pre><code>Set-Content : A positional parameter cannot be found that accepts 
  
  argument '$null'.
  At P:\CoverageVerifier\CombineTextFiles.ps1:8 char:50
  + ... thTrailer | Set-Content "${path}\\" + ${$dateStr} + "_CoverageVerifi ...
  +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : InvalidArgument: (:) [Set-Content], ParameterBindingException
      + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SetContentCommand
  </code></pre>
  
  <p>Here is my powershell code:</p>
  
  <pre><code>$path = "\\xx\\apps\\CoverageVerifier\\"
  $pathHeader = "\\xx\\apps\\CoverageVerifier\\Header.txt"
  $pathData = "\\xx\\apps\\CoverageVerifier\\Data.txt"
  $pathTrailer = "\\xx\\apps\\CoverageVerifier\\Trailer.txt"
  $date = Get-Date
  $dateStr = $date.ToString("yyyyMMdd")
  #Write-Output $dateStr
  Get-Content $pathHeader,$pathData,$pathTrailer | Set-Content "${path}\\cvgver." + ${dateStr} + ".0101"
  </code></pre>