Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $SourceFolder = "C:\Zippy" #folder the zip was created from
- $zipToTest = "C:\zippy.zip" #the zip to test
- $tempOutDir = "C:\Tempzip" #a temp folder used to unpack the zip to for checking
- Expand-Archive -LiteralPath $zipToTest -DestinationPath $tempOutDir -force
- $SRC = get-childitem -recurse -path $SourceFolder | foreach {get-filehash -path $_.FullName }
- $DST = get-childitem -recurse -path $tempOutDir | foreach {get-filehash -path $_.FullName }
- $SourceFolder
- $SRC
- write-host $SRC.count "items"
- "----------"
- ""
- $tempOutDir
- $DST
- write-host $DST.count "items"
- "----------"
- if ((Compare-Object -ReferenceObject $SRC -DifferenceObject $DST -Property hash -PassThru).Path){
- "DIFF"
- (Compare-Object -ReferenceObject $SRC -DifferenceObject $DST -Property hash -PassThru).Path
- }
- else{"ALL OK"}
- Remove-Item -LiteralPath $tempOutDir -Force -Recurse
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement