# 使用 7z 将 flag.txt 压缩到 unpack.zip
& '7z' a -tzip unpack.zip flag.txt | Out-Null

$start = 1
$end = 10000

# 循环压缩 10000 次
for ($i = $start; $i -le $end; $i++) {
    & '7z' a -tzip pack.zip unpack.zip | Out-Null
    Move-Item -Path pack.zip -Destination unpack.zip -Force | Out-Null
    
    $percentComplete = ($i / $end) * 100
    Write-Progress -PercentComplete $percentComplete -Status "Compressing" -Activity "$i of $end iterations complete"
}

# 结束后清除进度条
Write-Progress -Status "Compressing" -Activity "All iterations complete" -Completed

