<?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: Doug Waldron</title>
    <description>The latest articles on DEV Community by Doug Waldron (@guitarzan).</description>
    <link>https://dev.to/guitarzan</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%2F175168%2F60663d82-95f2-4eae-9019-c971b0c6fc65.jpg</url>
      <title>DEV Community: Doug Waldron</title>
      <link>https://dev.to/guitarzan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/guitarzan"/>
    <language>en</language>
    <item>
      <title>Installing software with winget &amp; automating installation with PowerShell</title>
      <dc:creator>Doug Waldron</dc:creator>
      <pubDate>Tue, 25 Jan 2022 19:38:22 +0000</pubDate>
      <link>https://dev.to/guitarzan/installing-software-with-winget-automating-installation-with-powershell-1pdf</link>
      <guid>https://dev.to/guitarzan/installing-software-with-winget-automating-installation-with-powershell-1pdf</guid>
      <description>&lt;p&gt;Windows released a new command line tool in 2021 for installing software called &lt;code&gt;winget&lt;/code&gt;. I recently got a new computer at work, so it was a good opportunity to try it out, and my verdict is: &lt;em&gt;wow, it's really good!&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Using &lt;a href="https://gist.github.com/dougwaldron/d510f2d67a922da169aca1aeff7e4c4d" rel="noopener noreferrer"&gt;this PowerShell script&lt;/a&gt;, within about 10 minutes I had installed over 30 applications with no interaction needed from me. &lt;small&gt;(I based my script on one originally created &lt;a href="https://gist.github.com/Codebytes/29bf18015f6e93fca9421df73c6e512c" rel="noopener noreferrer"&gt;by Chris Ayers&lt;/a&gt;)&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;Here's a quick tutorial on using &lt;code&gt;winget&lt;/code&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Winget comes pre-installed on new computers, but if you don't have it, just install the &lt;a href="https://www.microsoft.com/en-us/p/app-installer/9nblggh4nns1" rel="noopener noreferrer"&gt;App Installer&lt;/a&gt; from the Microsoft Store.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;winget list&lt;/code&gt; shows all applications you currently have installed and labels which ones are available through winget. This is a good way to prepare your own setup script, especially if you're planning to get a new computer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwnlzz6u5xdkt52e9y00q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwnlzz6u5xdkt52e9y00q.png" alt="Screenshot of  raw `winget list` endraw  results"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;winget search &amp;lt;name of app&amp;gt;&lt;/code&gt; to find out if an app you want can be installed through winget.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58yfnwq5f8wygy81ve56.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58yfnwq5f8wygy81ve56.png" alt="Screenshot of  raw `winget search "&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;winget install&lt;/code&gt; and &lt;code&gt;winget uninstall&lt;/code&gt; do exactly what you think.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can install each app separately using those commands. Or if you want to use the script to automate it, here's how to do that: &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Edit the &lt;a href="https://gist.github.com/dougwaldron/d510f2d67a922da169aca1aeff7e4c4d#file-installsoftware-ps1" rel="noopener noreferrer"&gt;&lt;code&gt;InstallSoftware.ps1&lt;/code&gt;&lt;/a&gt; file to include the apps you want.&lt;/li&gt;
&lt;li&gt;Start PowerShell as administrator.&lt;/li&gt;
&lt;li&gt;If running scripts is blocked (it should be), you can temporarily unblock them by running &lt;code&gt;Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Run the script and enjoy!&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffja549ezd2wgdk62y5jt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffja549ezd2wgdk62y5jt.png" alt="Screenshot of PowerShell script installing software"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>winget</category>
      <category>apps</category>
      <category>powershell</category>
      <category>script</category>
    </item>
  </channel>
</rss>
