New Computer Setup Checklist

New Computer Setup Checklist

The tools and customizations I like across all my machines in one handy place.

Windows

Apps are listed in the order I prefer to install them, starting right up front with my password manager to make everything else easier.

General Utilities

Editors

# Nerd Fonts, call after installing Oh My Posh
oh-my-posh font install

CLI

WSL

Default Ubuntu, from a PowerShell terminal prompt:

1
wsl --install

Winget Installs

Tools installable via winget

1
2
3
4
5
6
7
8
winget install JanDeDobbeleer.OhMyPosh -s winget
winget install jqlang.jq
winget install Git.Git
winget install 1password-cli
winget install Microsoft.PowerToys
winget install voidtools.Everything
winget install Wox.Wox
winget install Volta.Volta

Configurations

Environment Variables

1
SOURCE_ROOT=C:\Users\monoc\Dropbox\source

Git Configuration

1
2
3
4
5
6
# set default main branch to `main`
git config --global init.defaultBranch main

# Set user information
git config --global user.name "Shawn Oster"
git config --global user.email "shawn.oster@gmail.com"

Visual Studio Code

Extensions

Themes

  • Chandrian - a semantic syntax highlighting theme

Wox Configuration

  • Theme | BlurBlack
  • Plugin | Web Search | Change duckduckgo to d for faster typing

PowerShell Profile

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#
# Shawn Oster's PowerShell settings
#
# 1. Open profile settings with `code $PROFILE`
# 2. Paste everything
# 3. Reload shell with `. $PROFILE`
#
using namespace System.Management.Automation
using namespace System.Management.Automation.Language

# Set Oh My Posh prompt
#
# Quick install on Windows with winget: winget install "JanDeDobbeleer.OhMyPosh"
# Full instructions on offical site: https://ohmyposh.dev/docs/
oh-my-posh --init --shell pwsh --config $env:POSH_THEMES_PATH\space.omp.json | Invoke-Expression

# Tab-completion for winget
#
# winget is available in newer versions of Windows
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
    param($wordToComplete, $commandAst, $cursorPosition)
    [Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
    $Local:word = $wordToComplete.Replace('"', '""')
    $Local:ast = $commandAst.ToString().Replace('"', '""')
    winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
    }
}

# Tab-completion for dotnet CLI
#
# https://docs.microsoft.com/en-us/dotnet/core/tools/enable-tab-autocomplete
Register-ArgumentCompleter -Native -CommandName dotnet -ScriptBlock {
    param($commandName, $wordToComplete, $cursorPosition)
    dotnet complete --position $cursorPosition "$wordToComplete" | ForEach-Object {
        [System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
    }
}

# Tab-completion for 1Password
op completion powershell | Out-String | Invoke-Expression

# Tab-completion for volta
#
# generate with `volta completions powershell`
Register-ArgumentCompleter -Native -CommandName 'volta' -ScriptBlock {
    param($wordToComplete, $commandAst, $cursorPosition)

    $commandElements = $commandAst.CommandElements
    $command = @(
        'volta'
        for ($i = 1; $i -lt $commandElements.Count; $i++) {
            $element = $commandElements[$i]
            if ($element -isnot [StringConstantExpressionAst] -or
                $element.StringConstantType -ne [StringConstantType]::BareWord -or
                $element.Value.StartsWith('-') -or
                $element.Value -eq $wordToComplete) {
                break
            }
            $element.Value
        }) -join ';'

    $completions = @(switch ($command) {
            'volta' {
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-v', '-v', [CompletionResultType]::ParameterName, 'Prints the current version of Volta')
                [CompletionResult]::new('--version', '--version', [CompletionResultType]::ParameterName, 'Prints the current version of Volta')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
                [CompletionResult]::new('fetch', 'fetch', [CompletionResultType]::ParameterValue, 'Fetches a tool to the local machine')
                [CompletionResult]::new('install', 'install', [CompletionResultType]::ParameterValue, 'Installs a tool in your toolchain')
                [CompletionResult]::new('uninstall', 'uninstall', [CompletionResultType]::ParameterValue, 'Uninstalls a tool from your toolchain')
                [CompletionResult]::new('pin', 'pin', [CompletionResultType]::ParameterValue, 'Pins your project''s runtime or package manager')
                [CompletionResult]::new('list', 'list', [CompletionResultType]::ParameterValue, 'Displays the current toolchain')
                [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generates Volta completions')
                [CompletionResult]::new('which', 'which', [CompletionResultType]::ParameterValue, 'Locates the actual binary that will be called by Volta')
                [CompletionResult]::new('use', 'use', [CompletionResultType]::ParameterValue, 'use')
                [CompletionResult]::new('setup', 'setup', [CompletionResultType]::ParameterValue, 'Enables Volta for the current user / shell')
                [CompletionResult]::new('run', 'run', [CompletionResultType]::ParameterValue, 'Run a command with custom Node, npm, pnpm, and/or Yarn versions')
                [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
                break
            }
            'volta;fetch' {
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help')
                break
            }
            'volta;install' {
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help')
                break
            }
            'volta;uninstall' {
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help')
                break
            }
            'volta;pin' {
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help')
                break
            }
            'volta;list' {
                [CompletionResult]::new('--format', '--format', [CompletionResultType]::ParameterName, 'Specify the output format')
                [CompletionResult]::new('-c', '-c', [CompletionResultType]::ParameterName, 'Show the currently-active tool(s)')
                [CompletionResult]::new('--current', '--current', [CompletionResultType]::ParameterName, 'Show the currently-active tool(s)')
                [CompletionResult]::new('-d', '-d', [CompletionResultType]::ParameterName, 'Show your default tool(s)')
                [CompletionResult]::new('--default', '--default', [CompletionResultType]::ParameterName, 'Show your default tool(s)')
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
                break
            }
            'volta;completions' {
                [CompletionResult]::new('-o', '-o', [CompletionResultType]::ParameterName, 'File to write generated completions to')
                [CompletionResult]::new('--output', '--output', [CompletionResultType]::ParameterName, 'File to write generated completions to')
                [CompletionResult]::new('-f', '-f', [CompletionResultType]::ParameterName, 'Write over an existing file, if any')
                [CompletionResult]::new('--force', '--force', [CompletionResultType]::ParameterName, 'Write over an existing file, if any')
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
                break
            }
            'volta;which' {
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help')
                break
            }
            'volta;use' {
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help (see more with ''--help'')')
                break
            }
            'volta;setup' {
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help')
                break
            }
            'volta;run' {
                [CompletionResult]::new('--node', '--node', [CompletionResultType]::ParameterName, 'Set the custom Node version')
                [CompletionResult]::new('--npm', '--npm', [CompletionResultType]::ParameterName, 'Set the custom npm version')
                [CompletionResult]::new('--pnpm', '--pnpm', [CompletionResultType]::ParameterName, 'Set the custon pnpm version')
                [CompletionResult]::new('--yarn', '--yarn', [CompletionResultType]::ParameterName, 'Set the custom Yarn version')
                [CompletionResult]::new('--env', '--env', [CompletionResultType]::ParameterName, 'Set an environment variable (can be used multiple times)')
                [CompletionResult]::new('--bundled-npm', '--bundled-npm', [CompletionResultType]::ParameterName, 'Forces npm to be the version bundled with Node')
                [CompletionResult]::new('--no-pnpm', '--no-pnpm', [CompletionResultType]::ParameterName, 'Disables pnpm')
                [CompletionResult]::new('--no-yarn', '--no-yarn', [CompletionResultType]::ParameterName, 'Disables Yarn')
                [CompletionResult]::new('--verbose', '--verbose', [CompletionResultType]::ParameterName, 'Enables verbose diagnostics')
                [CompletionResult]::new('--very-verbose', '--very-verbose', [CompletionResultType]::ParameterName, 'Enables trace-level diagnostics')
                [CompletionResult]::new('--quiet', '--quiet', [CompletionResultType]::ParameterName, 'Prevents unnecessary output')
                [CompletionResult]::new('-h', '-h', [CompletionResultType]::ParameterName, 'Print help')
                [CompletionResult]::new('--help', '--help', [CompletionResultType]::ParameterName, 'Print help')
                break
            }
            'volta;help' {
                [CompletionResult]::new('fetch', 'fetch', [CompletionResultType]::ParameterValue, 'Fetches a tool to the local machine')
                [CompletionResult]::new('install', 'install', [CompletionResultType]::ParameterValue, 'Installs a tool in your toolchain')
                [CompletionResult]::new('uninstall', 'uninstall', [CompletionResultType]::ParameterValue, 'Uninstalls a tool from your toolchain')
                [CompletionResult]::new('pin', 'pin', [CompletionResultType]::ParameterValue, 'Pins your project''s runtime or package manager')
                [CompletionResult]::new('list', 'list', [CompletionResultType]::ParameterValue, 'Displays the current toolchain')
                [CompletionResult]::new('completions', 'completions', [CompletionResultType]::ParameterValue, 'Generates Volta completions')
                [CompletionResult]::new('which', 'which', [CompletionResultType]::ParameterValue, 'Locates the actual binary that will be called by Volta')
                [CompletionResult]::new('use', 'use', [CompletionResultType]::ParameterValue, 'use')
                [CompletionResult]::new('setup', 'setup', [CompletionResultType]::ParameterValue, 'Enables Volta for the current user / shell')
                [CompletionResult]::new('run', 'run', [CompletionResultType]::ParameterValue, 'Run a command with custom Node, npm, pnpm, and/or Yarn versions')
                [CompletionResult]::new('help', 'help', [CompletionResultType]::ParameterValue, 'Print this message or the help of the given subcommand(s)')
                break
            }
            'volta;help;fetch' {
                break
            }
            'volta;help;install' {
                break
            }
            'volta;help;uninstall' {
                break
            }
            'volta;help;pin' {
                break
            }
            'volta;help;list' {
                break
            }
            'volta;help;completions' {
                break
            }
            'volta;help;which' {
                break
            }
            'volta;help;use' {
                break
            }
            'volta;help;setup' {
                break
            }
            'volta;help;run' {
                break
            }
            'volta;help;help' {
                break
            }
        })

    $completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
    Sort-Object -Property ListItemText
}

#
# Aliases to common directories
#

# S is for Source
# Root directory for all source code (make sure to set SOURCE_ROOT)
function cds { Set-Location $env:SOURCE_ROOT }
function ss { sonar-scanner.bat -D"sonar.projectKey=$(Get-Location | Split-Path -Leaf)" -D"sonar.python.version=3" -D"sonar.sourceEncoding=UTF-8" }

# 1Password-secured Accounts
#
# IDs are meaningless without the password and thus safe for plaintext
function secure-env {
    # Secure variables, pulled from 1Password
    $env:SONAR_TOKEN = op read --account guild-education "op://Employee/SonarQube - Docker/token"
    $env:JIRA_API_USER = op read --account guild-education "op://Employee/sa-jinx-cli/username"
    $env:JIRA_API_KEY = op read --account guild-education "op://Employee/sa-jinx-cli/credential"
    $env:JIRA_SERVER_URL = op read --account guild-education "op://Employee/sa-jinx-cli/server"
}
function secure-groot { Set-Location (Join-Path $env:SOURCE_ROOT groot); op run --account my --env-file=.\app.env -- code . }
function secure-wonka { Set-Location (Join-Path $env:SOURCE_ROOT wonka); op run --account guild-education --env-file=.\wonka\app.env -- code . }
updatedupdated2024-09-152024-09-15