From b65f144d45149486167deed2677bc8bfa0bc102f Mon Sep 17 00:00:00 2001
From: Manuel Thalmann <m@nuth.ch>
Date: Wed, 19 Jul 2023 14:31:17 +0200
Subject: [PATCH] Fix non-functioning installation of choco profile

---
 scripts/Windows/Software/chocolatey/Install.ps1 | 6 ++++--
 scripts/Windows/Software/chocolatey/profile.ps1 | 6 ------
 2 files changed, 4 insertions(+), 8 deletions(-)
 delete mode 100644 scripts/Windows/Software/chocolatey/profile.ps1

diff --git a/scripts/Windows/Software/chocolatey/Install.ps1 b/scripts/Windows/Software/chocolatey/Install.ps1
index d3dd6800..2eaf3997 100644
--- a/scripts/Windows/Software/chocolatey/Install.ps1
+++ b/scripts/Windows/Software/chocolatey/Install.ps1
@@ -1,4 +1,6 @@
 #!/bin/pwsh
-. "$PSScriptRoot/profile.ps1";
-powershell "$PSScriptRoot/profile.ps1";
+powershell -c 'New-Item -Force $PROFILE';
+choco install --force chocolatey;
+Copy-Item -Force (powershell -c '$PROFILE') $PROFILE;
+
 Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1";
diff --git a/scripts/Windows/Software/chocolatey/profile.ps1 b/scripts/Windows/Software/chocolatey/profile.ps1
deleted file mode 100644
index 07395bd1..00000000
--- a/scripts/Windows/Software/chocolatey/profile.ps1
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/pwsh
-if (-not (Test-Path -PathType Leaf $PROFILE)) {
-    New-Item -Force $PROFILE;
-}
-
-choco install -y --force chocolatey;