Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VSCode Portable Auto-Updater

中文版

One-click download and update VSCode Portable to a specified directory. Supports stable and insider channels, auto-detects system architecture (x64 / arm64).

Usage

# Run directly (installs to VSCode/ next to the script)
.\Update-VSCodePortable.ps1

# Specify install path
.\Update-VSCodePortable.ps1 -Path "D:\tools\VSCode"

# Check for updates only
.\Update-VSCodePortable.ps1 -CheckOnly

Prerequisites

  • Windows 10 / 11 (or Windows Server 2016+)
  • PowerShell 5.1 or later
  • Administrator rights recommended (not required — a warning is shown if not elevated)

Parameters

Parameter Description
-Path <path> VSCode Portable install path (auto-saved when changed)
-Channel <stable|insider> Update channel, default stable
-Architecture <auto|x64|arm64> System architecture, default auto (auto-detect)
-Lang <zh|en> Display language, default en (auto-saved when changed)
-Force Skip all prompts, auto-close running VSCode
-CheckOnly Check version only, no download or update
-Restore <name|auto> Restore from backup, auto picks the latest
-Help Show help

Examples

# Install/update to default path (VSCode/ next to the script)
.\Update-VSCodePortable.ps1

# Install to a custom path
.\Update-VSCodePortable.ps1 -Path "D:\tools\VSCode"

# Use insider channel with arm64 architecture
.\Update-VSCodePortable.ps1 -Channel insider -Architecture arm64

# Skip all confirmation prompts
.\Update-VSCodePortable.ps1 -Force

# Check version only
.\Update-VSCodePortable.ps1 -CheckOnly

# Restore from backup
.\Update-VSCodePortable.ps1 -Restore auto

How It Works

  1. Queries the latest version via the official VSCode update API
  2. Compares with the current version; downloads the zip to Downloads\ if an update is available
  3. Backs up old files to VSCode-old-{timestamp}/ (preserves the data/ directory)
  4. Extracts the new version to the install directory
  5. Auto-saves install path and language preference

About Self-Modification

The script modifies itself to persist settings in the following cases:

  • First use of -Path → saves install path
  • Use of -Lang → saves language preference

This is intentional — keeping everything in a single file with no external config. If you manage it with git, these changes are expected.

License

MIT

About

Auto-update VSCode Portable on Windows - VSCode Portable 自动更新/安装脚本

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages