title: Comparing 2 folders and saving the paths into a variable?
body: <p>I've been given the task of comparing 2 folders, FolderA and FolderB and noting any files that exist in A but not in B. </p>
  
  <p>Sorry for not explaining myself fully.  Maybe it would help if I explain our situation.   A company sales employee has left our company to go to a competitor. He has files in on his work laptop local hard drive.  We are trying to establish if there are any files that exist on his computer but not on the shared network folder.   </p>
  
  <p>I need to produce a list of any files (along with their paths) that are present on his laptop but not on the share network location.  The file structure between the laptop local hard drive and the shared network location are different.   What's the best way to go about this?</p>
  
  <pre><code>$folderAcontent = "C:\temp\test1" 
  $folderBcontent = "C:\temp\test2"
  
  $FolderAContents = Get-ChildItem $folderAcontent -Recurse | where-object {!$_.PSIsContainer}
  $FolderBContents = Get-ChildItem $folderBcontent -Recurse | where-object {!$_.PSIsContainer}
  
  $FolderList = Compare-Object -ReferenceObject ($FolderAContents ) -DifferenceObject ($FolderBContents) -Property name
  $FolderList | fl * 
  </code></pre>