diff --git a/scripts/Windows/Scripts/Context.ps1 b/scripts/Windows/Scripts/Context.ps1 index 0efe17bd..a20bdca6 100644 --- a/scripts/Windows/Scripts/Context.ps1 +++ b/scripts/Windows/Scripts/Context.ps1 @@ -291,18 +291,19 @@ class Context { $accountSectionEntered = $true; } - if ( - ($line -eq "" -and $accountSectionEntered) -or - ( - (-not $accountSectionLeft) -and - ($line -ne "") -and - ($i -eq ($oldContent.Count - 1)) - )) { + if ($line -eq "" -and $accountSectionEntered) { $accountSectionLeft = $true; $newSettings; } $line; + + if ( + (-not $accountSectionLeft) -and + ($i -eq ($oldContent.Count - 1))) + { + $newSettings; + } }) | Set-Content ($this.GetNextcloudConfigFile()); Write-Information "New nextcloud config:";