<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Manny Berrueta</title>
    <description>The latest articles on DEV Community by Manny Berrueta (@manuelberrueta).</description>
    <link>https://dev.to/manuelberrueta</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F79757%2Fd782997c-dbeb-42b4-94d4-ccd08f98fa21.jpg</url>
      <title>DEV Community: Manny Berrueta</title>
      <link>https://dev.to/manuelberrueta</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/manuelberrueta"/>
    <language>en</language>
    <item>
      <title>Installing VSCode Extension From a List</title>
      <dc:creator>Manny Berrueta</dc:creator>
      <pubDate>Wed, 21 Oct 2020 20:40:18 +0000</pubDate>
      <link>https://dev.to/manuelberrueta/installing-vscode-extension-from-a-list-m7p</link>
      <guid>https://dev.to/manuelberrueta/installing-vscode-extension-from-a-list-m7p</guid>
      <description>&lt;p&gt;One of my favorite tools is VSCode. I like it’s versatility, the fact that I can use it with any language (that I use, anyway :)) it’s something I really like. As much as I like VSCode there is one thing I dislike doing, and that is, installing the extensions on a new VM or machine! Because I often spin up machines for testing, I wanted to see if there was a way to automate this.&lt;/p&gt;

&lt;p&gt;In my quest for a great VSCode hack, I found that VSCode supports cli and you can install the extensions via the command line using the code ‘code –install-extension ’ command. The caveat is that it can only take one argument at a time. Then I thought about making a script, but...wait for it....&lt;a href="https://stackoverflow.com/a/60805086/7869697"&gt;&lt;strong&gt;Stack Overflow&lt;/strong&gt;&lt;/a&gt; to save the day! That's right I found one in an answer before I even got started writing it. I modified the scripts to take a file containing the extension names as an argument.&lt;/p&gt;

&lt;p&gt;To backup your current extensions to feed it to the script use the command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;code &lt;span class="nt"&gt;--list-extensions&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; VSCode_Extension_List.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the script snippet for Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/usr/bin/env bash&lt;/span&gt;

&lt;span class="nb"&gt;cat&lt;/span&gt; &lt;span class="nv"&gt;$1&lt;/span&gt; | &lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;read &lt;/span&gt;extension &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="nt"&gt;-n&lt;/span&gt; &lt;span class="nv"&gt;$extension&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;do
  &lt;/span&gt;code &lt;span class="nt"&gt;--install-extension&lt;/span&gt; &lt;span class="nv"&gt;$extension&lt;/span&gt; &lt;span class="nt"&gt;--force&lt;/span&gt;
&lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the script snippet for Windows using PowerShell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight powershell"&gt;&lt;code&gt;&lt;span class="n"&gt;Get-Content&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;$args&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;|&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ForEach-Object&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="n"&gt;code&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;--install-extension&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="bp"&gt;$_&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I hope you find this useful, makes you a little happier and that it saves you some time!&lt;/p&gt;

</description>
      <category>vscode</category>
      <category>tips</category>
      <category>developer</category>
      <category>coding</category>
    </item>
  </channel>
</rss>
