From 4eb23fee10c21fba6bd2cd13d8166910b4ba95cb Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Sat, 15 Jul 2023 19:53:20 +0200
Subject: [PATCH] Clean up after automated download

---
 scripts/Windows/Scripts/BrowserAutomation.ps1 | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/Windows/Scripts/BrowserAutomation.ps1 b/scripts/Windows/Scripts/BrowserAutomation.ps1
index ff55e13c..3a6558f6 100644
--- a/scripts/Windows/Scripts/BrowserAutomation.ps1
+++ b/scripts/Windows/Scripts/BrowserAutomation.ps1
@@ -67,5 +67,7 @@ function Start-AutomatedDownload() {
     }
 
     $result = Move-Item $file $outDir -PassThru;
+    $browser.Close();
+    Remove-Item -Recurse $tempDir;
     return $result;
 }