February 22, 2021 · 3 min · 584 words · Ralf Gnädinger
Typically, you don’t install your operating system and all the tools too often. However, I had to do that exactly several times in the past two months.
The first time is still exciting, because you deal with the new functions and tools. The second time at the latest, the work through the configuration is annoying.
With this article I want to show how you can (partially) automate the installation and configuration of your tools and thus achieve a repoducible working environment.
tl;dr: I use a powershell script for installation and configuring my tools. You can find it in my GitHub repository.
I install my tools via with winget. Currently it is still in the status of a preview and has only limited functionality. But for my purposes it is fully sufficient. You have the choice to get it from the Windows Insider Program or directly as a release from GitHub Repository.
Due to the possibilities that arise from WSL2, I have completely switched and containerize all services that is possible.
You need Windows 10 Build 1903 or later.
The new Windows Terminal is an awsome replacement for the old cmd. To even improve the experience I use oh-my-posh with posh-git as extension. There are many different themes if they don’t like mine.
Install-Moduleposh-git-ScopeCurrentUserInstall-Moduleoh-my-posh-ScopeCurrentUser# Start the default settingsSet-Prompt# Alternatively set the desired theme:Set-ThemeSorinif(!(Test-Path-Path$PROFILE)){New-Item-TypeFile-Path$PROFILE-Force}Add-Content$PROFILE@'
Import-Module posh-git
Import-Module oh-my-posh
Set-Theme Sorin
'@$installFolder=Get-ChildItem$env:LOCALAPPDATA/Packages|Where-Object{$_.Name.StartsWith("Microsoft.WindowsTerminal")}if($installFolder.Count-eq1){Install-Fonts"./Meslo LG L Regular Nerd Font Complete Windows Compatible.ttf"Copy-Itemsettings.json$installFolder.FullName/LocalState-Force}