Improve automated downloads
This commit is contained in:
parent
93f97e2fed
commit
15977d0a97
1 changed files with 11 additions and 1 deletions
|
@ -16,7 +16,8 @@ function Start-AutomatedDownload() {
|
|||
param(
|
||||
[Context] $context,
|
||||
[string] $url,
|
||||
[string] $buttonSelector
|
||||
[string] $buttonSelector,
|
||||
[string] $outDir = $null
|
||||
)
|
||||
|
||||
$tempDir = $context.GetTempDirectory();
|
||||
|
@ -58,4 +59,13 @@ function Start-AutomatedDownload() {
|
|||
Write-Information "Waiting for download to finish...";
|
||||
Start-Sleep 1;
|
||||
}
|
||||
|
||||
$file = Get-ChildItem $tempDir;
|
||||
|
||||
if (-not $outDir) {
|
||||
$outDir = ".";
|
||||
}
|
||||
|
||||
$result = Move-Item $file $outDir -PassThru;
|
||||
return $result;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue