From 62a67954f6b8ff20ceb81fcd45e944dc1cc463a6 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 24 Aug 2024 16:27:34 +0200 Subject: [PATCH] Streamline WSL distribution name --- scripts/Windows/OS/Install.ps1 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/Windows/OS/Install.ps1 b/scripts/Windows/OS/Install.ps1 index 7d638b48..31a6c018 100644 --- a/scripts/Windows/OS/Install.ps1 +++ b/scripts/Windows/OS/Install.ps1 @@ -163,6 +163,16 @@ $null = New-Module { Copy-Item -Recurse -Force (Get-AppxPackage "*Ubuntu*").InstallLocation $wslLocation; Set-UserPermissions $wslLocation; & "$wslLocation\ubuntu.exe" install --root; + wsl --shutdown; + + & { + $tempDisk = New-TemporaryFile; + Move-Item $wslDisk $tempDisk; + wsl --deregister Ubuntu; + Move-Item $tempDisk $wslDisk; + wsl --import-in-place $distribution $wslDisk; + }; + continue; }