-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInvoke-SetupDevMachine.ps1
More file actions
92 lines (67 loc) · 3.05 KB
/
Copy pathInvoke-SetupDevMachine.ps1
File metadata and controls
92 lines (67 loc) · 3.05 KB
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
<#
.SYNOPSIS
Sets up a Windows developer machine with applications and configuration files.
.DESCRIPTION
This script configures a Windows developer machine by:
1. Installing applications via winget using a configuration file
2. Installing Nerd Fonts for terminal and development use
3. Creating symbolic links for configuration files from the repository to their expected system locations
4. Setting up development drive mappings
The script uses winget to install applications, downloads and installs fonts from GitHub,
and creates symbolic links based on a YAML configuration file.
Existing files are backed up before being replaced with symbolic links.
.PARAMETER SkipWinget
Skips the winget configuration step. Only fonts, symbolic links, and drive mappings will be created.
.PARAMETER SkipFonts
Skips the Nerd Fonts installation step. Useful if fonts are already installed or not needed.
.EXAMPLE
.\Invoke-SetupDevMachine.ps1
Sets up the machine with winget applications and creates symbolic links.
.EXAMPLE
.\Invoke-SetupDevMachine.ps1 -SkipWinget
Skips winget installation and only installs fonts, creates symbolic links, and sets up drive mappings.
.EXAMPLE
.\Invoke-SetupDevMachine.ps1 -SkipFonts
Skips font installation and only installs applications, creates symbolic links, and sets up drive mappings.
.EXAMPLE
.\Invoke-SetupDevMachine.ps1 -SkipWinget -SkipFonts
Skips both winget and font installation, only creates symbolic links and sets up drive mappings.
.EXAMPLE
.\Invoke-SetupDevMachine.ps1 -WhatIf
Shows what changes would be made without actually executing them.
.NOTES
- Requires PowerShell running as Administrator for creating symbolic links
- The winget configuration file should be located at: $PSScriptRoot\config\winget.yaml
- The symbolic links configuration file should be located at: $PSScriptRoot\config\symlinks.yaml
- Existing files are backed up with a timestamp before being replaced
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact='Medium')]
param (
[switch]$SkipWinget,
[switch]$SkipFonts
)
# Import modular scripts
. "$PSScriptRoot/scripts/Install-WinGet.ps1"
. "$PSScriptRoot/scripts/Initialize-DevDriveLetters.ps1"
. "$PSScriptRoot/scripts/New-Symlinks.ps1"
. "$PSScriptRoot/scripts/Install-NerdFonts.ps1"
function Invoke-SetupDevMachine
{
$ErrorActionPreference = "Stop"
# Configure Windows developer machine using winget
if (-not $SkipWinget) {
Install-WinGet
Invoke-WinGetConfiguration -ConfigPath "$PSScriptRoot\config\winget.yaml"
}
# Install Nerd Fonts (CaskaydiaCove for terminal/VSCode)
if (-not $SkipFonts) {
Install-NerdFonts -FontNames @("CascadiaCode")
}
# Initialize development drive mappings
Initialize-DevDriveLetters
# TODO: download portable apps
# Create symbolic links
New-Symlinks -ConfigPath "$PSScriptRoot\config\symlinks.yaml" -RepositoryRoot $PSScriptRoot
}
# Call the function with script parameters
Invoke-SetupDevMachine @PSBoundParameters