Guest User

List File Differences

a guest
Apr 6th, 2013
109
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. param(
  2.     [Parameter(Mandatory=$true)]
  3.     [string]$SourceFile,
  4.     [Parameter(Mandatory=$true)]
  5.     [string]$DestFile
  6. )
  7.  
  8. $str1 = @(Get-Content $SourceFile)
  9.  
  10. $str2 = @(Get-Content $DestFile)
  11.  
  12. Write-Host "Строки из $SourceFile, которые отсутствуют в $DestFile"
  13.  
  14. for($i = 0; $i -lt $str1.Count; $i++){
  15.     if ($str2 -notcontains $str1[$i]){
  16.         "[$i]: $($str1[$i])" | Out-Host
  17.     }
  18. }
  19.  
  20. Write-Host "========================================================================"
  21. Write-Host "Строки из $DestFile, которые отсутствуют в $SourceFile"
  22.  
  23. for($i = 0; $i -lt $str2.Count; $i++){
  24.     if ($str1 -notcontains $str2[$i]){
  25.         "[$i]: $($str2[$i])" | Out-Host
  26.     }
  27. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×