Repository navigation
Expand file tree
/
Copy pathMicrosoft.PowerShell_profile.ps1
More file actions
49 lines (40 loc) · 2.14 KB
/
Copy pathMicrosoft.PowerShell_profile.ps1
File metadata and controls
49 lines (40 loc) · 2.14 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
# Migrated by Pretty PowerShell setup
# Migration date: 2026-05-21 18:00:12 +02:00
# Repo-managed logic lives in standalone PrettyPowerShell.ps1
# Previous main profile backup: C:\Users\mikel\Documents\PowerShell\Backups\20260521-180005\Microsoft.PowerShell_profile.ps1
# Previous custom profile backup: C:\Users\mikel\Documents\PowerShell\Backups\20260521-180005\profile.ps1
# Pretty PowerShell loader
if (Test-Path 'C:\Users\mikel\Documents\PowerShell\PrettyPowerShell\PrettyPowerShell.ps1') {
. 'C:\Users\mikel\Documents\PowerShell\PrettyPowerShell\PrettyPowerShell.ps1'
}
# ---- BEGIN MIGRATED USER CUSTOMIZATIONS ----
# Load PATH (for alacritty); preserve paths injected into Herdr panes.
$HerdrPath = if ($env:HERDR_ENV -eq "1") { $env:PATH -split ";" }
$env:PATH = [System.Environment]::GetEnvironmentVariable("PATH", "Machine") + ";" +
[System.Environment]::GetEnvironmentVariable("PATH", "User")
if ($HerdrPath) {
$env:PATH = (($HerdrPath + ($env:PATH -split ";") | Select-Object -Unique) -join ";")
}
# Mise: activate project-local tool versions
if (Get-Command mise -ErrorAction SilentlyContinue) {
(& mise activate pwsh) | Out-String | Invoke-Expression
}
# Terminal Icons
Import-Module -Name Terminal-Icons
$PSUserPath = Split-Path $PROFILE
# Source Functions, Completions and Secrets
@("Functions", "Completions", "Secrets") | ForEach-Object {
Get-ChildItem "$PSUserPath\$_\*.ps1" -ErrorAction SilentlyContinue | ForEach-Object { . $_ }
}
# Winget Completions
Register-ArgumentCompleter -Native -CommandName winget -ScriptBlock {
param($wordToComplete, $commandAst, $cursorPosition)
[Console]::InputEncoding = [Console]::OutputEncoding = $OutputEncoding = [System.Text.Utf8Encoding]::new()
$Local:word = $wordToComplete.Replace('"', '""')
$Local:ast = $commandAst.ToString().Replace('"', '""')
winget complete --word="$Local:word" --commandline "$Local:ast" --position $cursorPosition |
ForEach-Object {
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
}
}
# ---- END MIGRATED USER CUSTOMIZATIONS ----