-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Install-WindowsTerminal.ps1
687 lines (552 loc) · 23.3 KB
/
Install-WindowsTerminal.ps1
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
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
<#PSScriptInfo
.VERSION 0.0.2
.GUID 98cb59b3-0489-4609-9c31-4f85be9433ea
.AUTHOR asheroto
.COMPANYNAME asheroto
.TAGS PowerShell Windows Terminal install installer script
.PROJECTURI https://github.com/asheroto/Install-WindowsTerminal
.RELEASENOTES
[Version 0.0.1] - Initial Release.
[Version 0.0.2] - Adjust UpdateSelf function to reset PSGallery to original state if it was not trusted.
#>
<#
.SYNOPSIS
Installs winget and Windows Terminal.
.DESCRIPTION
Installs winget and Windows Terminal.
.EXAMPLE
Install-WindowsTerminal
.PARAMETER Force
Ensures installation of winget and its dependencies, even if already present.
.PARAMETER UpdateSelf
Updates the script to the latest version on PSGallery.
.PARAMETER CheckForUpdate
Checks if there is an update available for the script.
.PARAMETER Version
Displays the version of the script.
.PARAMETER Help
Displays the full help information for the script.
.NOTES
Version : 0.0.2
Created by : asheroto
.LINK
Project Site: https://github.com/asheroto/Install-WindowsTerminal
#>
[CmdletBinding()]
param (
[switch]$Version,
[switch]$Help,
[switch]$CheckForUpdate,
[switch]$UpdateSelf,
[switch]$Force
)
# Version
$CurrentVersion = '0.0.2'
$RepoOwner = 'asheroto'
$RepoName = 'Install-WindowsTerminal'
$PowerShellGalleryName = 'Install-WindowsTerminal'
# Preferences
$ProgressPreference = 'SilentlyContinue' # Suppress progress bar (makes downloading super fast)
$ConfirmPreference = 'None' # Suppress confirmation prompts
# Display version if -Version is specified
if ($Version.IsPresent) {
$CurrentVersion
exit 0
}
# Display full help if -Help is specified
if ($Help) {
Get-Help -Name $MyInvocation.MyCommand.Source -Full
exit 0
}
# Display $PSVersionTable and Get-Host if -Verbose is specified
if ($PSBoundParameters.ContainsKey('Verbose') -and $PSBoundParameters['Verbose']) {
$PSVersionTable
Get-Host
}
# Set debug preferences if -Debug is specified
if ($PSBoundParameters.ContainsKey('Debug') -and $PSBoundParameters['Debug']) {
$DebugPreference = 'Continue'
$ConfirmPreference = 'None'
}
function CheckForUpdate {
param (
[string]$RepoOwner,
[string]$RepoName,
[version]$CurrentVersion,
[string]$PowerShellGalleryName
)
$Data = Get-GitHubRelease -Owner $RepoOwner -Repo $RepoName
Write-Output ""
Write-Output ("Repository: {0,-40}" -f "https://github.com/$RepoOwner/$RepoName")
Write-Output ("Current Version: {0,-40}" -f $CurrentVersion)
Write-Output ("Latest Version: {0,-40}" -f $Data.LatestVersion)
Write-Output ("Published at: {0,-40}" -f $Data.PublishedDateTime)
if ($Data.LatestVersion -gt $CurrentVersion) {
Write-Output ("Status: {0,-40}" -f "A new version is available.")
Write-Output "`nOptions to update:"
Write-Output "- Download latest release: https://github.com/$RepoOwner/$RepoName/releases"
if ($PowerShellGalleryName) {
Write-Output "- Run: $RepoName -UpdateSelf"
Write-Output "- Run: Install-Script $PowerShellGalleryName -Force"
}
} else {
Write-Output ("Status: {0,-40}" -f "Up to date.")
}
exit 0
}
function Write-Section($text) {
<#
.SYNOPSIS
Prints a text block surrounded by a section divider for enhanced output readability.
.DESCRIPTION
This function takes a string input and prints it to the console, surrounded by a section divider made of hash characters.
It is designed to enhance the readability of console output.
.PARAMETER text
The text to be printed within the section divider.
.EXAMPLE
Write-Section "Downloading Files..."
This command prints the text "Downloading Files..." surrounded by a section divider.
#>
Write-Output ""
Write-Output ("#" * ($text.Length + 4))
Write-Output "# $text #"
Write-Output ("#" * ($text.Length + 4))
Write-Output ""
}
function Strip-ProgressIndent {
param(
[ScriptBlock]$ScriptBlock,
[int]$Indentation = 4
)
# Function identical to Strip-Progress function by asheroto, but with an additional parameter to specify the indentation level
# https://gist.github.com/asheroto/96bcabe428e8ad134ef204573810041f
# Regex pattern to match spinner characters and progress bar patterns, now accounting for one or more spaces
$progressPattern = 'Γû[Æê]\s*|^\s*[-\\|/]\s*$'
# Adjusted regex pattern for size formatting to ensure it can handle variable spacing around the "/"
$sizePattern = '(\d+(\.\d{1,2})?)\s+(B|KB|MB|GB|TB|PB)\s*/\s*(\d+(\.\d{1,2})?)\s+(B|KB|MB|GB|TB|PB)'
$previousLineWasEmpty = $false # Track if the previous line was empty
& $ScriptBlock 2>&1 | ForEach-Object {
if ($_ -is [System.Management.Automation.ErrorRecord]) {
"ERROR: $($_.Exception.Message)"
} elseif ($_ -match '^\s*$') {
if (-not $previousLineWasEmpty) {
Write-Output ""
$previousLineWasEmpty = $true
}
} else {
$line = $_ -replace $progressPattern, '' -replace $sizePattern, '$1 $3 / $4 $6'
if (-not [string]::IsNullOrWhiteSpace($line)) {
$previousLineWasEmpty = $false
(' ' * $Indentation) + $line
}
}
}
}
function Get-CascadiaMonoUrl {
<#
.SYNOPSIS
Retrieves the download URL for the latest release of the Cascadia Mono font.
.DESCRIPTION
This function uses the GitHub API to get information about the latest release of the Cascadia Mono font, including its version and the date it was published. It then returns the download URL for the latest release.
.PARAMETER Match
The pattern to match in the asset names.
.EXAMPLE
Get-CascadiaMonoUrl
#>
$uri = "https://api.github.com/repos/microsoft/cascadia-code/releases"
$releases = Invoke-RestMethod -uri $uri -Method Get -ErrorAction stop
foreach ($release in $releases) {
if ($release.name -match "preview") {
continue
}
$data = $release.assets | Where-Object name -Like "CascadiaCode*.zip"
if ($data) {
return $data.browser_download_url
}
}
Write-Debug "Falling back to the latest release..."
$latestRelease = $releases | Select-Object -First 1
$data = $latestRelease.assets | Where-Object name -Match ".zip"
return
}
function Get-GitHubRelease {
<#
.SYNOPSIS
Fetches the latest release information of a GitHub repository.
.DESCRIPTION
This function uses the GitHub API to get information about the latest release of a specified repository, including its version and the date it was published.
.PARAMETER Owner
The GitHub username of the repository owner.
.PARAMETER Repo
The name of the repository.
.EXAMPLE
Get-GitHubRelease -Owner "asheroto" -Repo "winget-install"
This command retrieves the latest release version and published datetime of the winget-install repository owned by asheroto.
#>
[CmdletBinding()]
param (
[string]$Owner,
[string]$Repo
)
try {
$url = "https://api.github.com/repos/$Owner/$Repo/releases/latest"
$response = Invoke-RestMethod -Uri $url -ErrorAction Stop
$latestVersion = $response.tag_name
$publishedAt = $response.published_at
# Convert UTC time string to local time
$UtcDateTime = [DateTime]::Parse($publishedAt, [System.Globalization.CultureInfo]::InvariantCulture, [System.Globalization.DateTimeStyles]::RoundtripKind)
$PublishedLocalDateTime = $UtcDateTime.ToLocalTime()
[PSCustomObject]@{
LatestVersion = $latestVersion
PublishedDateTime = $PublishedLocalDateTime
}
} catch {
Write-Error "Unable to check for updates.`nError: $_"
exit 1
}
}
function CheckForUpdate {
param (
[string]$RepoOwner,
[string]$RepoName,
[version]$CurrentVersion,
[string]$PowerShellGalleryName
)
$Data = Get-GitHubRelease -Owner $RepoOwner -Repo $RepoName
Write-Output ""
Write-Output ("Repository: {0,-40}" -f "https://github.com/$RepoOwner/$RepoName")
Write-Output ("Current Version: {0,-40}" -f $CurrentVersion)
Write-Output ("Latest Version: {0,-40}" -f $Data.LatestVersion)
Write-Output ("Published at: {0,-40}" -f $Data.PublishedDateTime)
if ($Data.LatestVersion -gt $CurrentVersion) {
Write-Output ("Status: {0,-40}" -f "A new version is available.")
Write-Output "`nOptions to update:"
Write-Output "- Download latest release: https://github.com/$RepoOwner/$RepoName/releases"
if ($PowerShellGalleryName) {
Write-Output "- Run: $RepoName -UpdateSelf"
Write-Output "- Run: Install-Script $PowerShellGalleryName -Force"
}
} else {
Write-Output ("Status: {0,-40}" -f "Up to date.")
}
exit 0
}
function UpdateSelf {
try {
# Get PSGallery version of script
$psGalleryScriptVersion = (Find-Script -Name $PowerShellGalleryName).Version
# If the current version is less than the PSGallery version, update the script
if ($CurrentVersion -lt $psGalleryScriptVersion) {
Write-Output "Updating script to version $psGalleryScriptVersion..."
# Install NuGet PackageProvider if not already installed
Install-PackageProvider -Name "NuGet" -Force
# Trust the PSGallery if not already trusted
$psRepoInstallationPolicy = (Get-PSRepository -Name 'PSGallery').InstallationPolicy
if ($psRepoInstallationPolicy -ne 'Trusted') {
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted | Out-Null
}
# Update the script
Install-Script $PowerShellGalleryName -Force
# If PSGallery was not trusted, reset it to its original state
if ($psRepoInstallationPolicy -ne 'Trusted') {
Set-PSRepository -Name 'PSGallery' -InstallationPolicy $psRepoInstallationPolicy | Out-Null
}
Write-Output "Script updated to version $psGalleryScriptVersion."
exit 0
} else {
Write-Output "Script is already up to date."
exit 0
}
} catch {
Write-Output "An error occurred: $_"
exit 1
}
}
function Write-Section($text) {
<#
.SYNOPSIS
Prints a text block surrounded by a section divider for enhanced output readability.
.DESCRIPTION
This function takes a string input and prints it to the console, surrounded by a section divider made of hash characters.
It is designed to enhance the readability of console output.
.PARAMETER text
The text to be printed within the section divider.
.EXAMPLE
Write-Section "Downloading Files..."
This command prints the text "Downloading Files..." surrounded by a section divider.
#>
Write-Output ""
Write-Output ("#" * 80)
Write-Output "# $text #"
Write-Output ("#" * 80)
Write-Output ""
}
function Get-WingetStatus {
<#
.SYNOPSIS
Checks if winget is installed.
.DESCRIPTION
This function checks if winget is installed.
.EXAMPLE
Get-WingetStatus
#>
# Check if winget is installed
$winget = Get-Command -Name winget -ErrorAction SilentlyContinue
# If winget is installed, return $true
if ($null -ne $winget) {
return $true
}
# If winget is not installed, return $false
return $false
}
function Get-WindowsTerminalStatus {
<#
.SYNOPSIS
Checks if Windows Terminal is installed.
.DESCRIPTION
This function checks if Windows Terminal is installed.
.EXAMPLE
Get-WindowsTerminalStatus
#>
# Check if Windows Terminal is installed
$windowsTerminal = Get-Command -Name wt -ErrorAction SilentlyContinue
# If Windows Terminal is installed, return $true
if ($null -ne $windowsTerminal) {
return $true
}
# If Windows Terminal is not installed, return $false
return $false
}
function Get-CascadiaMonoStatus {
$systemFontDir = [System.IO.Path]::Combine($ENV:SystemRoot, "Fonts")
$userFontDir = [System.IO.Path]::Combine($ENV:USERPROFILE, "AppData", "Local", "Microsoft", "Windows", "Fonts")
$fontFileName = "CascadiaMono.ttf"
$systemFontPath = [System.IO.Path]::Combine($systemFontDir, $fontFileName)
$userFontPath = [System.IO.Path]::Combine($userFontDir, $fontFileName)
return (Test-Path -Path $systemFontPath) -or (Test-Path -Path $userFontPath)
}
function Test-AdminPrivileges {
<#
.SYNOPSIS
Checks if the script is running with Administrator privileges. Returns $true if running with Administrator privileges, $false otherwise.
.DESCRIPTION
This function checks if the current PowerShell session is running with Administrator privileges by examining the role of the current user. It returns $true if the current user is an Administrator, $false otherwise.
.EXAMPLE
Test-AdminPrivileges
.NOTES
This function is particularly useful for scripts that require elevated permissions to run correctly.
#>
if (([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
return $true
}
return $false
}
function New-TemporaryDirectory {
<#
.SYNOPSIS
Creates a new temporary directory.
.DESCRIPTION
This function generates a new directory with a unique name in the system's temporary path.
#>
# Get the system's temporary path
$parent = [System.IO.Path]::GetTempPath()
# Confirm the parent directory exists
if (-not (Test-Path -Path $parent)) {
Write-Error "Parent directory does not exist: $parent"
return
}
# Create a new directory with a unique name
$name = [System.Guid]::NewGuid().ToString()
$newTempDir = New-Item -ItemType Directory -Path ([System.IO.Path]::Combine($parent, $name))
# Return the path to the new directory
return $newTempDir.FullName
}
Function Install-Font {
<#
.SYNOPSIS
Installs fonts from a specified path on Windows systems.
.DESCRIPTION
The Install-Font function supports handling individual font files, directories containing multiple fonts, and wildcard paths. It also supports recursive search for font files in the specified path and all its subdirectories. The function is capable of installing both TTF and OTF font types.
.PARAMETER Path
Specifies the path to the font file(s). This can be a path to an individual font file, a directory containing font files, or a wildcard path. The function accepts both relative and absolute paths.
.PARAMETER Recursive
When specified, the function will recursively search for font files in the specified path and all its subdirectories. This is useful for bulk installations from directories with nested subfolders.
.EXAMPLE
Install-Font -Path ".\MyFont.ttf"
This example installs a single font file named 'MyFont.ttf' located in the current directory.
.EXAMPLE
Install-Font -Path ".\MyFont.otf"
This example installs a single font file named 'MyFont.otf' located in the current directory.
.EXAMPLE
Install-Font -Path "C:\Users\User\Downloads\*.ttf"
This example installs all TTF fonts located in the 'Downloads' folder of the 'User' directory.
.EXAMPLE
Install-Font -Path "*.ttf" -Recursive
This example installs all TTF fonts found in the current directory and its subdirectories.
#>
param (
[string]$Path,
[switch]$Recursive
)
# Get the path to the Fonts folder
$SystemFontsPath = [System.Environment]::GetFolderPath([System.Environment+SpecialFolder]::Fonts)
# Find all font files based on the given path
$fontFiles = Get-ChildItem -Path $Path -Recurse:$Recursive -File | Where-Object { $_.Extension -eq '.ttf' -or $_.Extension -eq '.otf' }
foreach ($file in $fontFiles) {
Write-Output "Installing $($file.Name)"
# Construct the path to the font file in the Fonts folder
$FontDestination = Join-Path -Path $SystemFontsPath -ChildPath $file.Name
# Get font name from font file
$ShellFolder = (New-Object -COMObject Shell.Application).Namespace($file.DirectoryName)
$ShellFile = $ShellFolder.ParseName($file.Name)
$FontType = $ShellFolder.GetDetailsOf($ShellFile, 2)
$FontName = $ShellFolder.GetDetailsOf($ShellFile, 21)
# Check if the file is a font file
If (-not ($FontType -Like '*font*')) {
Write-Output " $($file.Name) is not a recognized font file"
Continue
}
# If the font file doesn't exist in the Fonts folder
if (-not (Test-Path -Path $FontDestination)) {
# Copy the font file to the Fonts folder
Copy-Item -Path $file.FullName -Destination $FontDestination
# Register the font in the registry for persistence
$registryPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
if ($null -ne $FontName) {
$null = Set-ItemProperty -Path $registryPath -Name "$FontName (TrueType)" -Value $file.Name
}
Write-Output " Installed `"$FontName``"
} else {
Write-Output " `"$FontName`" is already installed"
}
}
}
# ============================================================================ #
# Initial checks
# ============================================================================ #
# First heading
Write-Output "Install-WindowsTerminal $CurrentVersion"
# Check for updates if -CheckForUpdate is specified
if ($CheckForUpdate) { CheckForUpdate -RepoOwner $RepoOwner -RepoName $RepoName -CurrentVersion $CurrentVersion -PowerShellGalleryName $PowerShellGalleryName }
# Update the script if -UpdateSelf is specified
if ($UpdateSelf) { UpdateSelf }
# Heading
Write-Output "To check for updates, run Install-WindowsTerminal -CheckForUpdate"
# ============================================================================ #
# Confirm running as administrator
# ============================================================================ #
if (!(Test-AdminPrivileges)) {
Write-Output "Please run this script as an administrator."
exit 1
}
# ============================================================================ #
# Install winget
# ============================================================================ #
# Heading
Write-Section "Prerequisites"
# Install winget if not already installed
if ((-not (Get-WingetStatus)) -or $Force) {
Write-Output "Installing winget..."
# Indent the process
Strip-ProgressIndent -ScriptBlock {
# Install NuGet PackageProvider
Install-PackageProvider -Name NuGet -Force -Confirm:$false | Out-Null
# Trust the PSGallery if not already trusted
$psRepoInstallationPolicy = (Get-PSRepository -Name 'PSGallery').InstallationPolicy
if ($psRepoInstallationPolicy -ne 'Trusted') {
Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted | Out-Null
}
# Install winget
Install-Script -Name winget-install -Force
winget-install -Force
# If PSGallery was not trusted, reset it to its original state
if ($psRepoInstallationPolicy -ne 'Trusted') {
Set-PSRepository -Name 'PSGallery' -InstallationPolicy $psRepoInstallationPolicy | Out-Null
}
}
# Confirm winget is installed
if (Get-WingetStatus) {
Write-Output "winget is installed."
} else {
Write-Warning "There was an issue installing winget which Windows Terminal depends on. Please try again."
exit 1
}
} else {
Write-Output "winget is already installed."
}
# ============================================================================ #
# Install Windows Terminal
# ============================================================================ #
# Heading
Write-Section "Windows Terminal"
# Install Windows Terminal if not already installed
if ((-not (Get-WindowsTerminalStatus)) -or $Force) {
# Install Windows Terminal
Write-Output "Installing Windows Terminal..."
# Indent the process
Strip-ProgressIndent -ScriptBlock {
winget install Microsoft.WindowsTerminal --accept-package-agreements --accept-source-agreements --force --silent --disable-interactivity
}
# Confirm Windows Terminal is installed
if (Get-WindowsTerminalStatus) {
Write-Output "Windows Terminal is installed."
} else {
# Install Windows Terminal using winget from the Microsoft Store
Write-Warning "Windows Terminal was not installed. Trying another method..."
# Indent the process
Strip-ProgressIndent -ScriptBlock {
winget install "windows terminal" --source "msstore" --accept-package-agreements --accept-source-agreements --force --silent --disable-interactivity
}
if (Get-WindowsTerminalStatus) {
Write-Output "Windows Terminal is installed."
} else {
Write-Warning "There was an issue installing Windows Terminal. Please refer to any error messages above for more information."
exit 1
}
}
} else {
Write-Output "Windows Terminal is already installed."
}
# ============================================================================ #
# Install Cascadia Mono font
# ============================================================================ #
# Heading
Write-Section "Cascadia Mono font"
# Confirm that the Cascadia Mono font is not already installed system or user
if ((-not (Get-CascadiaMonoStatus)) -or $Force) {
Write-Output "Installing Cascadia Mono (includes Cascadia Code)..."
# Indent the process
Strip-ProgressIndent -ScriptBlock {
# Define vars
$ProgressPreference = 'SilentlyContinue'
$url = Get-CascadiaMonoUrl
# Create a new folder for the download
$downloadFolder = New-TemporaryDirectory
# Download the zip file
$zipFile = [System.IO.Path]::Combine($downloadFolder, "CascadiaCode.zip")
Invoke-WebRequest -Uri $url -OutFile $zipFile
# Extract the zip file
Expand-Archive -Path $zipFile -DestinationPath $downloadFolder
# Set ttf path
$ttfPath = [System.IO.Path]::Combine($downloadFolder, "ttf")
# Install the font (not recursive to avoid installing static fonts)
Install-Font -Path $ttfPath
# Clean up
Remove-Item -Path $downloadFolder -Recurse -Force
}
# Confirm the font is installed
if (Get-CascadiaMonoStatus) {
Write-Output "Cascadia Mono font installed successfully."
} else {
Write-Warning "There was an issue installing the Cascadia Mono font. Please refer to any error messages above for more information."
exit 1
}
} else {
Write-Output "Cascadia Mono font is already installed."
}
# ============================================================================ #
# Complete
# ============================================================================ #
# Heading
Write-Section "Complete"
Write-Output "Windows Terminal is now installed and ready to use."