Skip to content

Commit a862d0a

Browse files
committed
add win_reinstall_vscode
1 parent ce50f43 commit a862d0a

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

os/win.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ function win_admin_romove_current_user() {
7272

7373
# -- install --
7474

75+
function win_reinstall_vscode {
76+
winget uninstall Microsoft.VisualStudioCode --silent --force
77+
$vscode_data_paths = @(
78+
"$env:APPDATA\Code",
79+
"$env:LOCALAPPDATA\Code",
80+
"$env:USERPROFILE\.vscode",
81+
"$env:TEMP\vscode-update"
82+
)
83+
foreach ($path in $vscode_data_paths) {
84+
if (Test-Path $path) {
85+
Remove-Item -Recurse -Force $path
86+
}
87+
}
88+
winget install Microsoft.VisualStudioCode --silent
89+
}
90+
7591
function win_install_exe_from_zip() {
7692
# if the basename of extractPath exist inside extracted Path so get from inside that folder
7793
# For example: win_install_exe_from_zip ""...\vlc-3.0.21.zip" "...\bin\vlc-3.0.21" "vlc.exe"

0 commit comments

Comments
 (0)