List changed files

This topic contains 1 reply, has 1 voice, and was last updated by Profile photo of Tony Wainwright Tony Wainwright 1 year, 8 months ago.

  • Author
    Posts
  • #29207
    Profile photo of Tony Wainwright
    Tony Wainwright
    Participant

    Hi

    Is there a way I can create a list of files that are on D: but not in F:, are in F:\ but not in D and have changed in F: since a particular date?
    Am trying to use GCI and compare-object but am getting mixed up with the options
    Thanks

  • #29208
    Profile photo of Tony Wainwright
    Tony Wainwright
    Participant

    This is what I currently have:

    $srce = Get-ChildItem -Path F:\HSTVDATA\HSTV_Share -Recurse | Select-Object -Property FullName, Length, LastWriteTime
    $dest = Get-ChildItem -Path D:\HSTVDATA\HSTV_Share -Recurse | Select-Object -Property FullName, Length, LastWriteTime
    
    Compare-Object $srce $dest -Property FullName, Length, LastWriteTime | Format-Table- Autosize | Out-String -Width 4096 | Out-File C:\Tony\Compare.txt

You must be logged in to reply to this topic.