title: Powershell error copy-item cannot bind argument to parameter 'path' because it is null
body: <p>I am rather new to Powershell and have a question regarding the error I'm receiving. After browsing through stack overflow I have found that users have made errors in spelling and the like and so I haven't found a suitable answer to my problem.</p>
  
  <p>I have one script that runs a backup of some data and compresses it and stores it as:</p>
  
  <blockquote>
    <p>yyyyMMdd<em>sometext</em>.7z</p>
  </blockquote>
  
  <p>I have another script to get the latest backup (if it was created) and copy it to another location </p>
  
  <p>I am receiving an error </p>
  
  <blockquote>
    <p>copy-item cannot bind argument to parameter 'path' because it is null</p>
  </blockquote>
  
  <p>Does this mean that the file is non-existent or is it an error in any of the below?</p>
  
  <pre><code>$c = $textBox.Text
  $a = (Get-Date).AddDays(-1).ToString($c)                                                        
  $b = Get-ChildItem "C:\BackupsRP1" -Filter *.7z | Where-Object BaseName -like "*$a*" 
  Copy-Item $b -Destination "C:\Users\user\Desktop"
  </code></pre>
  
  <p>Above the code is a simple GUI for the user to input the date in the format yyyyMMdd and it will locate the file one less day than the user inputs and copy it to the location.</p>
  
  <p>Thank you,
  J</p>