Ignore unfinished browser downloads

This commit is contained in:
Manuel Thalmann 2024-08-16 17:57:22 +02:00
parent 530f6d1a34
commit 55043420aa

View file

@ -68,8 +68,9 @@ $null = New-Module {
$downloadChecker = {
$files = Get-ChildItem $dir;
if ((@($files)).Count -gt 0) {
foreach ($file in $files) {
if ((@($files)).Count -eq 1) {
$file = $files[0];
try {
$stream = [System.IO.File]::Open($file.FullName, [System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None);
@ -80,7 +81,6 @@ $null = New-Module {
catch {
return $true;
}
}
return $false;
} else {