From 0609221a8e46ddeef1c1c7e42568ee694b6adbcf Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Tue, 25 Jul 2023 12:40:35 +0200
Subject: [PATCH] Remove non-existent variable

---
 scripts/Windows/Scripts/Context.ps1 | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/scripts/Windows/Scripts/Context.ps1 b/scripts/Windows/Scripts/Context.ps1
index d3b89e9b..0efe17bd 100644
--- a/scripts/Windows/Scripts/Context.ps1
+++ b/scripts/Windows/Scripts/Context.ps1
@@ -285,22 +285,24 @@ class Context {
 
         $(
             for ($i = 0; $i -lt $oldContent.Count; $i++) {
-                if ($_ -eq "[Accounts]") {
+                $line = $oldContent[$i];
+
+                if ($line -eq "[Accounts]") {
                     $accountSectionEntered = $true;
                 }
 
                 if (
-                    ($_ -eq "" -and $accountSectionEntered) -or
+                    ($line -eq "" -and $accountSectionEntered) -or
                     (
                         (-not $accountSectionLeft) -and
-                        ($_ -ne "") -and
+                        ($line -ne "") -and
                         ($i -eq ($oldContent.Count - 1))
                     )) {
                     $accountSectionLeft = $true;
                     $newSettings;
                 }
 
-                $_;
+                $line;
             }) | Set-Content ($this.GetNextcloudConfigFile());
 
         Write-Information "New nextcloud config:";