2017-07-05 15 views

答えて

0

最も簡単な1(フォルダ(複数可)内のすべてのXMLファイルに対して再帰的にことになるだろう):

$folder1 = "" 
$folder2 = "" 

$fol1 = Get-ChildItem -Recurse $folder1 -Filter *.xml| select name, directory, CreationTime 
$fol2 = Get-ChildItem -Recurse $folder2 -Filter *.xml| select name, directory, CreationTime 

Compare-Object $fol1 $fol2 -Property name -PassThru | select name, CreationTime, @{ 
    N = "Folder"; e= { 
     if ($_.sideindicator -eq "=>") { "Not Found in $folder2" } 
     elseif ($_.sideindicator -eq "<=") { "Not Found in $folder1" } 
    } 
} 

出力:

Name     CreationTime   Folder 
----     ------------   ------ 
New Text Document.txt 7/5/2017 1:24:35 PM  Not Found in G:\xxx 
1.exe     6/14/2017 3:17:29 PM Not Found in G:\111 
1.dll     6/14/2017 3:17:37 PM Not Found in G:\1 
関連する問題