Skip to content

Instantly share code, notes, and snippets.

@vmandic
Created July 25, 2018 14:08
Show Gist options
  • Select an option

  • Save vmandic/ef80f1097521c16063b3b1c3a687d244 to your computer and use it in GitHub Desktop.

Select an option

Save vmandic/ef80f1097521c16063b3b1c3a687d244 to your computer and use it in GitHub Desktop.
Batch install vscode extensions with PowerShell
# Script for batch installing Visual Studio Code extensions
# Specify extensions to be checked & installed by modifying $extensions
$extensions =
"DotJoshJohnson.xml",
"EditorConfig.EditorConfig",
"HookyQR.beautify",
"Leopotam.csharpfixformat",
"ecmel.vscode-html-css",
"formulahendry.auto-close-tag",
"formulahendry.auto-rename-tag",
"jchannon.csharpextensions",
"jorgeserrano.vscode-csharp-snippets",
"k--kato.docomment",
"ms-mssql.mssql",
"ms-vscode.csharp",
"nepaul.editorconfiggenerator",
"rahulsahay.Csharp-ASPNETCore",
"robertohuertasm.vscode-icons",
"schneiderpat.aspnet-helper",
"temilaj.asp-net-core-vs-code-extension-pack"
$cmd = "code --list-extensions"
Invoke-Expression $cmd -OutVariable output | Out-Null
$installed = $output -split "\s"
foreach ($ext in $extensions) {
if ($installed.Contains($ext)) {
Write-Host $ext "already installed." -ForegroundColor Gray
} else {
Write-Host "Installing" $ext "..." -ForegroundColor White
code --install-extension $ext
}
}
@usnoozeyulosey
Copy link
Copy Markdown

thank you

@nonchris
Copy link
Copy Markdown

Note.: If this script just opens Instances of VSCode, try replacing code with code.cmd in line 23 and 32.

This directs to the CLI wrapper, whilst your code probably points to the code.exe (you can find out using Get-Command code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment