Files
dotfiles/lk-installers/install-ohmyposh.ps1
T
lkrav 77a8d25488 Add Windows support: linker, oh-my-posh installer, README
- link-dotfiles.ps1: stow-equivalent for Windows using junctions/symlinks
  (no admin required), idempotent with .bak backups and -DryRun
- lk-installers/install-ohmyposh.ps1: winget-based install with fallback
- README.md: document Linux/macOS (stow) and Windows flows
- .gitignore: resolve leftover merge conflict markers, ignore *.bak
- ohmyposh/lkraven.toml: oh-my-posh v3 auto-migrated this on load (same
  theme, upgraded schema)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-08 13:22:33 -07:00

28 lines
1.0 KiB
PowerShell

#!/usr/bin/env pwsh
<#
.SYNOPSIS
Install oh-my-posh on Windows (parity with ./lk-installers/install-ohmyposh).
.DESCRIPTION
Uses winget when available; otherwise falls back to the official installer.
No administrator rights are required (installs to the current user).
#>
[CmdletBinding()]
param()
$ErrorActionPreference = 'Stop'
if (Get-Command oh-my-posh -ErrorAction SilentlyContinue) {
Write-Host "oh-my-posh already installed: $((Get-Command oh-my-posh).Source)"
return
}
if (Get-Command winget -ErrorAction SilentlyContinue) {
Write-Host "Installing oh-my-posh via winget..."
winget install JanDeDobbeleer.OhMyPosh -s winget --accept-source-agreements --accept-package-agreements
} else {
Write-Host "winget not found; using the official installer script..."
Set-ExecutionPolicy Bypass -Scope Process -Force
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
}
Write-Host "Done. Open a new shell so PATH refreshes, then run .\link-dotfiles.ps1"