Fix broken download detection
This commit is contained in:
parent
7db3d35e86
commit
93f97e2fed
1 changed files with 2 additions and 2 deletions
|
@ -30,7 +30,7 @@ function Start-AutomatedDownload() {
|
||||||
|
|
||||||
$files = Get-ChildItem $tempDir;
|
$files = Get-ChildItem $tempDir;
|
||||||
|
|
||||||
if ($(@($files)).Count -ge 0) {
|
if ($(@($files)).Count -gt 0) {
|
||||||
foreach ($file in Get-ChildItem $tempDir) {
|
foreach ($file in Get-ChildItem $tempDir) {
|
||||||
try {
|
try {
|
||||||
$stream = [System.IO.File]::Open($file.FullName, [System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None);
|
$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 {
|
} else {
|
||||||
return $false;
|
return $true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue