Ignore unfinished browser downloads
This commit is contained in:
parent
530f6d1a34
commit
55043420aa
|
@ -68,8 +68,9 @@ $null = New-Module {
|
||||||
$downloadChecker = {
|
$downloadChecker = {
|
||||||
$files = Get-ChildItem $dir;
|
$files = Get-ChildItem $dir;
|
||||||
|
|
||||||
if ((@($files)).Count -gt 0) {
|
if ((@($files)).Count -eq 1) {
|
||||||
foreach ($file in $files) {
|
$file = $files[0];
|
||||||
|
|
||||||
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);
|
||||||
|
|
||||||
|
@ -80,7 +81,6 @@ $null = New-Module {
|
||||||
catch {
|
catch {
|
||||||
return $true;
|
return $true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return $false;
|
return $false;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue