Möchte man wissen, welche Dateien und Verzeichnisse nach einem Update verschwinden, hilft das folgende Powershell Codefragment.
$Folder1="C:\temp\A1" $Folder2="C:\temp\A2" $SourceFileTabel = @{} $DeletedFiles = @() foreach($File in Get-ChildItem $Folder2 -Recurse){ if (!(Test-Path $File.FullName -PathType Container )) { $tmp = $Folder2 -replace "\\","\\" $SourceFileTabel.Add(($File.FullName -replace $tmp),$File.Name) } } foreach($File in Get-ChildItem $Folder1 -Recurse){ if (!(Test-Path $File.FullName -PathType Container)) { #File not found! $tmp = $Folder1 -replace "\\","\\" if($SourceFileTabel[($File.FullName -replace $tmp)] -eq $null){ $DeletedFiles += ($File.FullName -replace $tmp) } } } "Deleted Files" foreach($item in $DeletedFiles){ $item }
Kommentare