I am trying to test integrity of ZIP file
It looks like this command is working but I got many details about the file. I want to get a result if the test passed or failed in order to move to the next step.
Any idea how to do it? Something like:
$TestZip = 7z t \\bandit\global\QA\AgileTeam\bandit\Builds\8.6.22.607\8.6.22.607.10.zip
if ($TestZip)
{The test passed}
else
{Test failed}
The output is:
Path = \\bandit\global\QA\AgileTeam\bandit\Builds\8.6.22.607\8.6.22.607.10.zip
Type = zip
Physical Size = 5738248794
64-bit = +
Characteristics = Zip64
Everything is Ok
Files: 902
Size: 5927324719
Compressed: 5738248794
Tried this:
$TestZip = 7z t \\bandit\global\QA\AgileTeam\bandit\Builds\8.6.22.607\8.6.22.607.10.zip | set out
$ok = $out -like '*Everything is Ok*'
if ($ok) {write-host "Integrity test for Zip file passed"}