Warning
Use an administrator account for these steps, and keep a recent backup before making repair or security changes.
What you will achieve
Install and update Windows software from the terminal with Microsoft’s winget CLI.
1) Search and install packages
winget search vscode
winget install --id Microsoft.VisualStudioCode -e
2) Upgrade installed packages
winget upgrade
winget upgrade --all
3) Export package list for rebuilds
winget export -o winget-packages.json