-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.ps1
More file actions
51 lines (43 loc) · 2.39 KB
/
Copy pathbootstrap.ps1
File metadata and controls
51 lines (43 loc) · 2.39 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
# bootstrap.ps1 (ASCII only)
# One-shot installer: fetches then installs the trackpad and the Magic Mouse drivers.
# Elevates ONCE, then calls both install scripts with -NoPause.
#
# Neither driver is shipped with this repository - each install script fetches its
# own driver first (from Apple for the mouse, from the upstream GitHub release for
# the trackpad). See README.md.
#
# Usage: powershell -ExecutionPolicy Bypass -File bootstrap.ps1
# Options: -SkipTrackpad -SkipMouse -Keyboard
param([switch]$SkipTrackpad, [switch]$SkipMouse, [switch]$Keyboard)
$principal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent())
if (-not $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {
Write-Host "Elevation to administrator..." -ForegroundColor Yellow
$fwd = @()
if ($SkipTrackpad) { $fwd += '-SkipTrackpad' }
if ($SkipMouse) { $fwd += '-SkipMouse' }
if ($Keyboard) { $fwd += '-Keyboard' }
Start-Process powershell.exe -Verb RunAs -ArgumentList "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`" $fwd"
return
}
$ErrorActionPreference = "Stop"
$scripts = Join-Path $PSScriptRoot 'scripts'
Write-Host "`n ==================================================" -ForegroundColor Cyan
Write-Host " Apple Magic devices - Windows 11 bootstrap" -ForegroundColor Cyan
Write-Host " ==================================================`n" -ForegroundColor Cyan
if (-not $SkipTrackpad) {
Write-Host ">>> Trackpad" -ForegroundColor Magenta
& "$scripts\Install-Trackpad.ps1" -NoPause
} else { Write-Host ">>> Trackpad skipped" -ForegroundColor DarkGray }
if (-not $SkipMouse) {
Write-Host "`n>>> Magic Mouse" -ForegroundColor Magenta
& "$scripts\Install-MagicMouse.ps1" -NoPause
} else { Write-Host ">>> Mouse skipped" -ForegroundColor DarkGray }
if ($Keyboard) {
Write-Host "`n>>> Keyboard layout (French - Apple)" -ForegroundColor Magenta
& "$scripts\Install-KeyboardLayout.ps1" -NoPause
}
Write-Host "`n ==================================================" -ForegroundColor Green
Write-Host " All done. Test scroll on trackpad and mouse." -ForegroundColor Green
Write-Host " 3/4-finger gestures: Settings > Bluetooth & devices > Touchpad" -ForegroundColor Green
Write-Host " ==================================================" -ForegroundColor Green
Write-Host "`nPress Enter to close..."; Read-Host