From 0da955a90db6205a2e4915e4d713327829278701 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 25 Nov 2024 11:56:41 +0100 Subject: [PATCH] replace dism.exe for CMD with builtin powershell module --- util/wsl.psm1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/wsl.psm1 b/util/wsl.psm1 index 47fa620..1128e30 100644 --- a/util/wsl.psm1 +++ b/util/wsl.psm1 @@ -1,8 +1,8 @@ function InstallWSL { # Reference: https://learn.microsoft.com/en-us/windows/wsl/install-manual - dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart - dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart + Enable-WindowsOptionalFeature -Online -FeatureName "Microsoft-Windows-Subsystem-Linux" -All -NoRestart + Enable-WindowsOptionalFeature -Online -FeatureName "VirtualMachinePlatform" -All -NoRestart wsl.exe --install --no-distribution wsl.exe --set-default-version 2 }