# 抽查 3 个文件 md5 $sampleIds = @('9.jpg', '200.jpg', '407.jpg') $downloaded = 'D:\Softwares\phpstudy_pro\WWW\fenleixinxi\tmp_img\downloaded' Write-Host "=== MD5 抽查 ===" $hashes = @() foreach ($f in $sampleIds) { $fullPath = Join-Path $downloaded $f if (Test-Path $fullPath) { $size = (Get-Item $fullPath).Length $hash = (Get-FileHash $fullPath -Algorithm MD5).Hash Write-Host "$f | size=$size | md5=$hash" $hashes += $hash } else { Write-Host "$f | MISSING!" } } Write-Host "" $uniqueHashes = $hashes | Select-Object -Unique Write-Host "Unique MD5 count: $($uniqueHashes.Count) / $($hashes.Count)" if ($uniqueHashes.Count -eq $hashes.Count) { Write-Host "PASS: All 3 sampled files have different MD5 hashes." } else { Write-Host "FAIL: Some MD5 hashes are identical!" } # Also check total count of jpg files $allJpg = (Get-ChildItem $downloaded -Filter *.jpg -File).Count Write-Host "" Write-Host "Total .jpg files in downloaded/: $allJpg"