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. 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 laptops local hard drive and the shared network location are different. Its only file names i'm interested in comparing as the location between the 2 sets of folders have different structures. The definition of a match is if file name and size are the same. I've created the code below but it doesnt give me the path? Can anyone help me solve this problem?
$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