title: Powershell - Compare Folder Contents
body: <p>I have the below code which compares the two folders and outputs the files different with respect to each folder, is there a way to get this to output the full file/folder path for files in subfolders?</p>
  
  <p>Cheers</p>
  
  <pre><code> # Create varaibles to store folder paths - pass to Strings... 
   param([string]$argFolderA,[string]$argFolderB)
  
   # Set variables for folder
   $FolderA = Get-ChildItem -Recurse -path $argFolderA
   $FolderB = Get-ChildItem -Recurse -path $argFolderB
  
   # Compare the contents and output the files different within each folder. 
   Compare-Object -ReferenceObject $FolderA -DifferenceObject $FolderB &gt;&gt; C:\CmpOut.txt
  </code></pre>