Advertisement
Guest User

Untitled

a guest
Oct 8th, 2019
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $SourceFolder = "C:\Zippy"     #folder the zip was created from
  2. $zipToTest    = "C:\zippy.zip" #the zip to test
  3. $tempOutDir   = "C:\Tempzip"   #a temp folder used to unpack the zip to for checking
  4.  
  5. Expand-Archive -LiteralPath $zipToTest -DestinationPath $tempOutDir -force
  6.  
  7. $SRC = get-childitem -recurse -path $SourceFolder | foreach {get-filehash -path $_.FullName }
  8.  
  9. $DST = get-childitem -recurse -path $tempOutDir | foreach {get-filehash -path $_.FullName }
  10.  
  11. $SourceFolder
  12. $SRC
  13. write-host $SRC.count "items"
  14. "----------"
  15. ""
  16. $tempOutDir
  17. $DST
  18. write-host $DST.count "items"
  19. "----------"
  20. if ((Compare-Object -ReferenceObject $SRC -DifferenceObject $DST  -Property hash -PassThru).Path){
  21.     "DIFF"
  22.     (Compare-Object -ReferenceObject $SRC -DifferenceObject $DST  -Property hash -PassThru).Path
  23. }
  24. else{"ALL OK"}
  25.  
  26. Remove-Item -LiteralPath $tempOutDir -Force -Recurse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement