指令筆記,想偷懶也可以用別人寫好的 powershell 工具 https://github.com/pxlrbt/move-wsl
- 列舉所有 WSL
wsl --list
- 執行 export
wsl --export {distribution-name} D:\path\2\tarfile\{distribution-name}.tar
- 匯入
wsl.exe --import {new-distribution-name} D:\folder\2\install\ D:\path\2\tarfile\{distribution-name}.tar
- 移除舊的 distribution
wsl --unregister {distribution-name}