wsl查看磁盘文件并清理空间
用管理员打开powershell(根据ubuntu系统修改):
(Get-ChildItem -Path HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss | Where-Object { $_.GetValue("DistributionName") -eq 'Ubuntu-20.04' }).GetValue("BasePath") + "\ext4.vhdx"
清理无用空间:
wsl --shutdown # 关闭所有 WSL 实例
Stop-Service com.docker.service # 停止 Docker 服务(若安装)
diskpart
select vdisk file="<文件路径>"
detach vdisk # 强制卸载
exit