Fix broken download detection

This commit is contained in:
Manuel Thalmann 2023-07-15 19:41:43 +02:00
parent 7db3d35e86
commit 93f97e2fed

View file

@ -30,7 +30,7 @@ function Start-AutomatedDownload() {
$files = Get-ChildItem $tempDir;
if ($(@($files)).Count -ge 0) {
if ($(@($files)).Count -gt 0) {
foreach ($file in Get-ChildItem $tempDir) {
try {
$stream = [System.IO.File]::Open($file.FullName, [System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None);
@ -46,7 +46,7 @@ function Start-AutomatedDownload() {
}
}
} else {
return $false;
return $true;
}
}