- powershell_greeting: PowerShell port of fish_greeting (fastfetch random logo, sixel/kitty-direct per terminal, logs, modes) - win-gm-switch: Rust port of gm-switch.cpp (cross-platform mode file, --status, Start Menu shortcuts installer) - install-windows.ps1 umbrella installer; README pointers
60 lines
1.7 KiB
PowerShell
60 lines
1.7 KiB
PowerShell
# Install the J621 Windows extras (PowerShell greeting + Rust gm-switch).
|
|
#
|
|
# Usage:
|
|
# .\install-windows.ps1
|
|
# .\install-windows.ps1 -Url https://j621.example.ts.net -Token <token>
|
|
# .\install-windows.ps1 -NoPrompt
|
|
# .\install-windows.ps1 -Uninstall
|
|
#
|
|
# Options are forwarded to the component installers (see
|
|
# powershell_greeting\install.ps1 and win-gm-switch\install.ps1).
|
|
|
|
[CmdletBinding()]
|
|
param(
|
|
[string]$Url,
|
|
[string]$Token,
|
|
[switch]$NoPrompt,
|
|
[switch]$Force,
|
|
[switch]$NoProfilePatch,
|
|
[switch]$SkipGreeting,
|
|
[switch]$SkipGmSwitch,
|
|
[switch]$Uninstall
|
|
)
|
|
|
|
$ErrorActionPreference = 'Stop'
|
|
|
|
$here = $PSScriptRoot
|
|
if (-not $here) { $here = Split-Path -Parent $MyInvocation.MyCommand.Path }
|
|
$failures = New-Object System.Collections.Generic.List[string]
|
|
|
|
if (-not $SkipGmSwitch) {
|
|
Write-Host ''
|
|
Write-Host '=== gm-switch ==='
|
|
$params = @{}
|
|
if ($Uninstall) { $params.Uninstall = $true }
|
|
& (Join-Path $here 'win-gm-switch\install.ps1') @params
|
|
if ($LASTEXITCODE -ne 0) { $failures.Add('gm-switch installer failed') }
|
|
}
|
|
|
|
if (-not $SkipGreeting) {
|
|
Write-Host ''
|
|
Write-Host '=== PowerShell greeting ==='
|
|
$params = @{}
|
|
if ($Uninstall) { $params.Uninstall = $true }
|
|
if ($Url) { $params.Url = $Url }
|
|
if ($Token) { $params.Token = $Token }
|
|
if ($NoPrompt) { $params.NoPrompt = $true }
|
|
if ($Force) { $params.Force = $true }
|
|
if ($NoProfilePatch) { $params.NoProfilePatch = $true }
|
|
& (Join-Path $here 'powershell_greeting\install.ps1') @params
|
|
if ($LASTEXITCODE -ne 0) { $failures.Add('greeting installer failed') }
|
|
}
|
|
|
|
Write-Host ''
|
|
if ($failures.Count -eq 0) {
|
|
Write-Host 'All done.'
|
|
exit 0
|
|
}
|
|
foreach ($failure in $failures) { Write-Host $failure }
|
|
exit 1
|