首页 > 解决方案 > Powershell 在新 PC 上安装所有 vscode 扩展

问题描述

我有当前脚本,它在新计算机上安装巧克力并安装我所有的主要应用程序并确认它们是最新的:

#Requires -RunAsAdministrator

# Install chocolatey packet manager
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

# Install needed packages (these can be changed to suit your needs)
choco install brave discord microsoft-teams microsoft-office-deployment vscode visualstudio2019community sql-server-management-studio tableau-desktop git -y

# Confirm all software is up to date
choco update all -y

我想知道是否有一种方法可以在此脚本的末尾也可以将我所有的 vscode 扩展安装到新的 PC(Windows)上。

标签: windowspowershellvisual-studio-code

解决方案


如果有人需要它,可以使用 PowerShell 编写一个很酷的解决方案。这是 Github 上的项目。/ PowerShell 画廊

总之,VS-Code 和扩展是这样安装的:

Install-Script Install-VSCode; Install-VSCode.ps1 -AdditionalExtensions 'ms-azuretools.vscode-azurefunctions', 'ms-python.python'

推荐阅读