Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brucebentley/5f2e498e978da1a929d9f819b139b379 to your computer and use it in GitHub Desktop.
Save brucebentley/5f2e498e978da1a929d9f819b139b379 to your computer and use it in GitHub Desktop.
Windows 10 Development Environment Setup

Windows 10 Development Environment Setup

Table of Contents

Package Managers

A package manager is a system or set of tools used to automate installing, upgrading, configuring and using software. Most package managers are designed for discovering and installing developer tools.

Ideally, developers use a package manager to specify the prerequisites for the tools they need to develop solutions for a given project. The package manager then follows the declarative instructions to install and configure the tools. The package manager reduces the time spent getting an environment ready, and it helps ensure the same versions of packages are installed on their machine.

Third party package managers can leverage the Microsoft Community Package Manifest Repository to increase the size of their software catalog.

Winget

winget install wingetcreate

The winget command line tool enables developers to discover, install, upgrade, remove and configure applications on Windows 10 computers. This tool is the client interface to the Windows Package Manager service.

The winget tool is currently a preview, so not all planned functionality is available at this time.

Installation

There are several ways to install the winget tool:

 
NOTE:
The winget tool requires Windows 10, version 1809 ( 10.0.17763 ), or a later version of Windows 10.
 

Administrator Considerations

Installer behavior can be different depending on whether you are running winget with administrator privileges.

When running winget without administrator privileges, some applications may require elevation to install. When the installer runs, Windows will prompt you to elevate. If you choose not to elevate, the application will fail to install.

When running winget in an Administrator Command Prompt, you will not see elevation prompts if the application requires it. Always use caution when running your command prompt as an administrator, and only install applications you trust.

winget Docs →

Chocolatey

Chocolatey Install

tl;dr Chocolatey is a software management solution that allows you to manage 100% of your software, anywhere you have Windows, with any endpoint management tool. No other solution ( including newly announced solutions ) reach this level of management - most only can manage to software in Programs and Features.

Chocolatey is a software management solution unlike anything else you've ever experienced on Windows. It focuses on simplicity, security, and infinite scalability. You write a software deployment in PowerShell once for any software ( not just installers ), then you can deploy it everywhere you have Windows with any solution that can manage systems ( configuration management, endpoint management, etc. ) and track and manage updates of that software over time. Manage software on-premise, in the "Cloud", or in Docker containers with Chocolatey.

Whew, that was a mouthful! For a bit more detail into what all of that means and more, see What is Chocolatey?

Installation

  1. First, ensure that you are using an administrative shell - you can also install as a non-admin, check out Non-Administrative Installation.

  2. Install with powershell.exe

     
    NOTE:
    Please inspect the Chocolately's install.ps1 script prior to running any of these scripts to ensure safety. We already know it's safe, but you should verify the security and contents of any script from the internet you are not familiar with. All of these scripts download a remote PowerShell script and execute it on your machine. We take security very seriously. Learn more about our security protocols.
     

    With PowerShell, you must ensure Get-ExecutionPolicy is not Restricted. We suggest using Bypass to bypass the policy to get things installed or AllSigned for quite a bit more security.

    • Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -Scope Process.

    Now run the following command:

    Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  3. Paste the copied text into your shell and press Enter.

  4. Wait a few seconds for the command to complete.

  5. If you don't see any errors, you are ready to use Chocolatey! Type choco or choco -? now, or see Getting Started for usage instructions.

Chocolatey Docs →

Scoop

Scoop installs programs from the command line with a minimal amount of friction. It tries to eliminate things like:

  • Permission popup windows
  • GUI wizard-style installers
  • Path pollution from installing lots of programs
  • Unexpected side-effects from installing and uninstalling programs
  • The need to find and install dependencies
  • The need to perform extra setup steps to get a working program

Scoop is very scriptable, so you can run repeatable setups to get your environment just the way you like, e.g.:

scoop install sudo
sudo scoop install 7zip git openssh --global
scoop install aria2 curl grep sed less touch
scoop install python ruby go perl

If you've built software that you'd like others to use, Scoop is an alternative to building an installer ( e.g. MSI or InnoSetup ) — you just need to zip your program and provide a JSON manifest that describes how to install it.

Installation

Run the following command from your PowerShell to install scoop to its default location ( C:\Users\<user>\scoop )

Invoke-Expression (New-Object System.Net.WebClient).DownloadString('https://get.scoop.sh')

# or shorter
iwr -useb get.scoop.sh | iex

Once installed, run scoop help for instructions.

The default setup is configured so all user installed programs and Scoop itself live in C:\Users\<user>\scoop. Globally installed programs ( --global ) live in C:\ProgramData\scoop. These settings can be changed through environment variables.

Install Scoop To A Custom Directory By Changing SCOOP

$env:SCOOP='D:\Applications\Scoop'
[Environment]::SetEnvironmentVariable('SCOOP', $env:SCOOP, 'User')
# run the installer

Configure Scoop To Install Global Programs To A Custom Directory By Changing SCOOP_GLOBAL

$env:SCOOP_GLOBAL='F:\GlobalScoopApps'
[Environment]::SetEnvironmentVariable('SCOOP_GLOBAL', $env:SCOOP_GLOBAL, 'Machine')
# run the in

Scoop Docs →


Tools & Platforms

Windows Subsystem for Linux ( WSL )

Windows Subsystem for Linux ( WSL )

WSL Docs →

Prerequisites

You must be running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11.

 
Note:
To check your Windows version and build number, select Windows logo key + R, type winver, select OK. You can update to the latest Windows version in the Settings menu or using the Windows Update Assistant.
 

If you're running an older build, or just prefer not to use the install command and would like step-by-step directions, see WSL manual installation steps for older versions.

Install

You can now install everything you need to run Windows Subsystem for Linux ( WSL ) by entering this command in PowerShell or Windows Command Prompt and then restarting your machine.

You can now install everything you need to run Windows Subsystem for Linux ( WSL ) by entering this command in PowerShell or Windows Command Prompt and then restarting your machine.

wsl --install

This command will enable the required optional components, download the latest Linux kernel, set WSL 2 as your default, and install a Linux distribution for you ( Ubuntu by default, see below to change this ).

The first time you launch a newly installed Linux distribution, a console window will open and you'll be asked to wait for files to de-compress and be stored on your machine. All future launches should take less than a second.

Change the default Linux distribution installed

By default, the installed Linux distribution will be Ubuntu. This can be changed using the -d flag.

To change the distribution installed, enter: wsl --install -d <Distribution Name>. Replace <Distribution Name> with the name of the distribution you would like to install. To see a list of available Linux distributions available for download through the online store, enter: wsl --list --online or wsl -l -o. To install additional Linux distributions after the initial install, you may also use the command: wsl --install -d <Distribution Name>.

 
💡 TIP:
If you want to install additional distributions from inside a Linux/Bash command line ( rather than from PowerShell or Command Prompt), you must use .exe in the command: wsl.exe --install -d <Distribution Name> or to list available distributions: wsl.exe -l -o.
 

If you run into an issue during the install process, check the installation section of the troubleshooting guide.

Set Up Your Linux User Info

Once you have installed WSL, you will need to create a user account and password for your newly installed Linux distribution. See the Best practices for setting up a WSL development environment guide to learn more.

Set Up And Best Practices

We recommend following our Best practices for setting up a WSL development environment guide for a step-by-step walk-through of how to set up a user name and password for your installed Linux distribution(s), using basic WSL commands, installing and customizing Windows Terminal, set up for Git version control, code editing and debugging using the VS Code remote server, good practices for file storage, setting up a database, mounting an external drive, setting up GPU acceleration, and more.

Windows Terminal

Windows Terminal is a modern terminal application for users of command-line tools and shells like Command Prompt, PowerShell, and Windows Subsystem for Linux ( WSL ). Its main features include multiple tabs, panes, Unicode and UTF-8 character support, a GPU accelerated text rendering engine, and the ability to create your own themes and customize text, colors, backgrounds, and shortcuts.

Install Windows Terminal

Windows Terminal Docs →

Install

To try the latest preview features, you may also want to install Windows Terminal Preview.

 
NOTE:
If you don't have access to the Microsoft Store, the builds are published on the GitHub releases page. If you install from GitHub, Windows Terminal will not automatically update with new versions. For additional installation options using a package manager ( winget, chocolatey, scoop ), see the Windows Terminal product repo.

Set Your Default Terminal Application ( Preview )

To open any command line application with Windows Terminal, set it as your default terminal application.

  1. Open Windows Terminal And Go To The Settings Ui Window.
  2. Select Startup and choose "Windows Terminal" as the Default terminal application setting.

Microsoft PowerToys

Microsoft PowerToys

Microsoft PowerToys is a set of utilities for power users to tune and streamline their Windows experience for greater productivity. For more info on PowerToys overviews and how to use the utilities, or any other tools and resources for Windows development environments, head over to docs.microsoft.com!

Current Utilities
Awake Color Picker
Keyboard Manager PowerRename

PowerToys Docs →

Installation & Setup

Requirements
  • ⚠️ PowerToys (v0.37.0 and newer) requires Windows 10 v1903 (18362) or newer.
  • Have .NET Core 3.1.15 Desktop Runtime. The installer should handle this but we want to directly make people aware.

Via GitHub with EXE [ Recommended ]

Stable Version

Install from the Microsoft Store's PowerToys page or use Microsoft PowerToys GitHub releases page.

  • For GitHub, click on Assets to show the files available in the release and then click on PowerToysSetup-0.47.1-x64.exe to download the PowerToys installer.
  • For Microsoft Store, you must be using the new Microsoft Store which will be available for both Windows 11 and Windows 10.

This is the preferred method.

Experimental Version

To install the Video Conference mute, please use the v0.46 experimental version of PowerToys to try out this version. It includes all improvements from v0.45 in addition to the Video conference utility. Click on Assets to show the files available in the release and then download the .exe installer.

Via WinGet ( Preview )

Download PowerToys from WinGet. To install PowerToys, run the following command from the command line / PowerShell:

WinGet install powertoys

Other Install Methods

There are community driven install methods such as Chocolatey and Scoop. If these are your preferred install solutions, this will have the install instructions.

Visual Studio

Visual Studio Docs →

Installation & Setup

Step 1 - Make sure your computer is ready for Visual Studio

Before you begin installing Visual Studio:

  1. Check the system requirements. These requirements help you know whether your computer supports Visual Studio 2019.
  2. Apply the latest Windows updates. These updates ensure that your computer has both the latest security updates and the required system components for Visual Studio.
  3. Reboot. The reboot ensures that any pending installs or updates don't hinder your Visual Studio install.
  4. Free up space. Remove unneeded files and applications from your system drive by, for example, running the Disk Cleanup app.

For questions about running previous versions of Visual Studio side by side with Visual Studio 2019, see Visual Studio 2019 Platform Targeting and Compatibility.

Step 2 - Download Visual Studio

Next, download the Visual Studio bootstrapper file.

To do so, choose the following button, choose the edition of Visual Studio that you want, choose Save, and then choose Open folder.

Download Visual Studio

Step 3 - Install the Visual Studio Installer

Run the bootstrapper file to install the Visual Studio Installer. This new lightweight installer includes everything you need to both install and customize Visual Studio.

  1. From your Downloads folder, double-click the bootstrapper that matches or is similar to one of the following files:

    • vs_community.exe for Visual Studio Community
    • vs_professional.exe for Visual Studio Professional
    • vs_enterprise.exe for Visual Studio Enterprise

    If you receive a User Account Control notice, choose Yes.

  2. We'll ask you to acknowledge the Microsoft License Terms] and the Microsoft Privacy Statement. Choose Continue. Screenshot showing the Microsoft License Terms and Privacy Statement


Next Steps

Installing AWS Tools for PowerShell on Windows →

A Windows-based computer can run any of the AWS Tools for PowerShell package options:

  • AWS.Tools - The modularized version of AWS Tools for PowerShell. Each AWS service is supported by its own individual, small module, with shared support modules AWS.Tools.Common and AWS.Tools.Installer.
  • AWSPowerShell.NetCore - The single, large-module version of AWS Tools for PowerShell. All AWS services are supported by this single, large module.
  • AWSPowerShell - The legacy Windows-specific, single, large-module version of AWS Tools for PowerShell. All AWS services are supported by this single, large module.

The package you choose depends on the release and edition of Windows that you're running.

ℹ️ Note:
The Tools for Windows PowerShell ( AWSPowerShell module ) are installed by default on all Windows-based Amazon Machine Images ( AMIs ).

Setting up the AWS Tools for PowerShell involves the following high-level tasks, described in detail in this topic.

  1. Install the AWS Tools for PowerShell package option that's appropriate for your environment.
  2. Verify that script execution is enabled by running the Get-ExecutionPolicy cmdlet.
  3. Import the AWS Tools for PowerShell module into your PowerShell session.

Prerequisites

Ensure that you meet the requirements listed in Prerequisites for Setting up the AWS Tools for PowerShell.

Newer versions of PowerShell, including PowerShell Core, are available as downloads from Microsoft at Installing various versions of PowerShell on Microsoft's Web site.

Install AWS.Tools on Windows

You can install the modularized version of AWS Tools for PowerShell on computers that are running Windows with Windows PowerShell 5.1, or PowerShell Core 6.0 or later. For information about how to install PowerShell Core, see Installing various versions of PowerShell on Microsoft's Web site.

You can install AWS.Tools in one of three ways:

  • Using the cmdlets in the AWS.Tools module. The AWS.Tools.Installer module simplifies the installation and update of other AWS.Tools modules. The AWS.Tools.Installer requires, automatically downloads and installs, an updated version of PowerShellGet. The AWS.Tools.Installer module and automatically keeps your module versions in sync. When you install or update to a newer version of one module, the cmdlets in the AWS.Tools.Installer automatically update all of your other AWS.Tools modules to the same version.
  • Downloading the modules from AWS.Tools.zip and extracting them in one of the module folders. You can discover your module folders by printing the value of the $Env:PSModulePath variable.
  • Installing each service module from the PowerShell Gallery using the Install-Module cmdlet, as described in the following procedure.

To install AWS.Tools on Windows using the Install-Module cmdlet

  1. Start a PowerShell session.

    ℹ️ Note:
    We recommend that you don't run PowerShell as an administrator with elevated permissions except when required by the task at hand. This is because of the potential security risk and is inconsistent with the principle of least privilege.

  2. To install the modularized AWS.Tools package, run the following command.
    > Install-Module -Name AWS.Tools.Installer
    
    Untrusted repository
    You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy   value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): y   ```
  3. You can now install the module for each AWS service that you want to use by using the Install-AWSToolsModule cmdlet. For example, the following command installs the IAM module. This command also installs any dependent modules that are required for the specified module to work. For example, when you install your first AWS.Tools service module, it also installs AWS.Tools.Common. This is a shared module required by all AWS service modules. It also removes older versions of the modules, and updates other modules to the same newer version.
    > Install-AWSToolsModule AWS.Tools.EC2,AWS.Tools.S3 -CleanUp
    
    Confirm
    Are you sure you want to perform this action?
    Performing the operation "Install-AWSToolsModule" on target "AWS Tools version 4.0.0.0".
    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
    
    Installing module AWS.Tools.Common version 4.0.0.0
    Installing module AWS.Tools.EC2 version 4.0.0.0
    Installing module AWS.Tools.Glacier version 4.0.0.0
    Installing module AWS.Tools.S3 version 4.0.0.0
    
    Uninstalling AWS.Tools version 3.3.618.0
    Uninstalling module AWS.Tools.Glacier
    Uninstalling module AWS.Tools.S3
    Uninstalling module AWS.Tools.SimpleNotificationService
    Uninstalling module AWS.Tools.SQS
    Uninstalling module AWS.Tools.Common

By default, this command installs modules into the $HOME\Documents\PowerShell\Modules folder. To install the AWS Tools for PowerShell for all users of a computer, you must run the following command in a PowerShell session that you started as an administrator. This installs modules to the $env:ProgramFiles\PowerShell\Modules folder that is accessible by all users.

> Install-AWSToolsModule AWS.Tools.IdentityManagement -Scope AllUsers

Enable Script Execution

To load the AWS Tools for PowerShell modules, you must enable PowerShell script execution. To enable script execution, run the Set-ExecutionPolicy cmdlet to set a policy of RemoteSigned. For more information, see About Execution Policies on the Microsoft Technet website.

ℹ️ Note:
This is a requirement only for computers that are running Windows. The ExecutionPolicy security restriction is not present on other operating systems.

To enable script execution

  1. Administrator rights are required to set the execution policy. If you are not logged in as a user with administrator rights, open a PowerShell session as Administrator. Choose Start, and then choose All Programs. Choose Accessories, and then choose Windows PowerShell. Right-click Windows PowerShell, and on the context menu, choose Run as administrator.
  2. At the command prompt, enter the following.
> Set-ExecutionPolicy RemoteSigned 

If you don't have the execution policy set correctly, PowerShell shows the following error whenever you try to run a script, such as your profile.

File C:\Users\username\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1 cannot be loaded because the execution
 of scripts is disabled on this system. Please see "get-help about_signing" for more details.
At line:1 char:2
+ . <<<<  'C:\Users\username\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'
    + CategoryInfo          : NotSpecified: (:) [], PSSecurityException
    + FullyQualifiedErrorId : RuntimeException

The Tools for Windows PowerShell installer automatically updates the PSModulePath to include the location of the directory that contains the AWSPowerShell module.

Because the PSModulePath includes the location of the AWS module's directory, the Get-Module -ListAvailable cmdlet shows the module.

> Get-Module -ListAvailable

ModuleType Name                      ExportedCommands
---------- ----                      ----------------
Manifest   AppLocker                 {}
Manifest   BitsTransfer              {}
Manifest   PSDiagnostics             {}
Manifest   TroubleshootingPack       {}
Manifest   AWSPowerShell             {Update-EBApplicationVersion, Set-DPStatus, Remove-IAMGroupPol...

Updating the AWS Tools for PowerShell on Windows

Periodically, as updated versions of the AWS Tools for PowerShell are released, you should update the version that you are running locally.

Update the Modularized AWS.Tools

To upgrade your AWS.Tools modules to the latest version, run the following command.

> Update-AWSToolsModule -CleanUp

This command updates all of the currently installed AWS.Tools modules and, after a successful update, removes other installed versions.

ℹ️ Note:
The Update-AWSToolsModule cmdlet downloads all modules from the PSRepository named PSGallery ( https://www.powershellgallery.com/ ) and considers it a trusted source. Use the command: Get-PSRepository -Name PSGallery for more information on this PSRepository.




Bruce's Installed AWS.Tools Modules

> Install-AWSToolsModule \
        AWS.Tools.Account, \
        AWS.Tools.APIGateway, \
        AWS.Tools.ApiGatewayV2, \
        AWS.Tools.CloudFormation, \
        AWS.Tools.CloudWatch, \
        AWS.Tools.CloudWatchEvidently, \
        AWS.Tools.CloudWatchLogs, \
        AWS.Tools.CodeArtifact, \
        AWS.Tools.CodeBuild, \
        AWS.Tools.CodeCommit, \
        AWS.Tools.CodeDeploy, \
        AWS.Tools.CodeGuruProfiler, \
        AWS.Tools.CodeGuruReviewer, \
        AWS.Tools.CodePipeline, \
        AWS.Tools.CodeStar, \
        AWS.Tools.CodeStarNotifications, \
        AWS.Tools.CodeStarconnections, \
        AWS.Tools.DynamoDBv2, \
        AWS.Tools.EC2, \
        AWS.Tools.ECR, \
        AWS.Tools.ECRPublic, \
        AWS.Tools.ECS, \
        AWS.Tools.EKS, \
        AWS.Tools.EventBridge, \
        AWS.Tools.Glue, \
        AWS.Tools.IdentityManagement, \
        AWS.Tools.IdentityStore, \
        AWS.Tools.LakeFormation, \
        AWS.Tools.Lambda, \
        AWS.Tools.RAM, \
        AWS.Tools.RDS, \
        AWS.Tools.RDSDataService, \
        AWS.Tools.Route53, \
        AWS.Tools.Route53Domains, \
        AWS.Tools.Route53RecoveryCluster, \
        AWS.Tools.Route53RecoveryControlConfig, \
        AWS.Tools.Route53RecoveryReadiness, \
        AWS.Tools.Route53Resolver, \
        AWS.Tools.S3, \
        AWS.Tools.S3Control, \
        AWS.Tools.S3Outposts, \
        AWS.Tools.SSO, \
        AWS.Tools.SSOAdmin, \
        AWS.Tools.SSOOIDC, \
        AWS.Tools.SimpleNotificationService, \
        AWS.Tools.WAF, \
        AWS.Tools.WAFRegional, \
        AWS.Tools.WAFV2 \
    -CleanUp
    
Confirm
Are you sure you want to perform this action?
Performing the operation "Install-AWSToolsModule" on target "AWS Tools version 4.0.0.0".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment