$passwords = Get-Content "C:\path\passwords.txt"
$7ZipPath = "C:\Program Files-Zipz.exe"
$zipFile = "C:\path\file.zip"
foreach ($password in $passwords)
{
Write-Host $password
& $7ZipPath "t" $zipFile "-p$password"
if (-Not $?)
{
Write-Host $password "is not the password."
} else {
Write-Host $password "is the password."
}
}
pause