在 win 中的 “启动或关闭 Windows 功能 “中突然找不到 Hyper-V
相关的选项,同时 wsl 无法启动。
在桌面新建一个 .bat
文件,内容为 ```
pushd "%~dp0"
dir /b %SystemRoot%\servicing\Packages\*Hyper-V*.mum >hyper-v.txt
for /f %%i in ('findstr /i . hyper-v.txt 2^>nul') do dism /online /norestart /add-package:"%SystemRoot%\servicing\Packages\%%i"
del hyper-v.txt
Dism /online /enable-feature /featurename:Microsoft-Hyper-V -All /LimitAccess /ALL
pause
以管理员身份运行脚本后即可重新打开 Hyper-V