-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathps-profile.ps1
More file actions
39 lines (32 loc) · 1.05 KB
/
ps-profile.ps1
File metadata and controls
39 lines (32 loc) · 1.05 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
#region Aliases
$ar = get-alias -name g -ErrorAction SilentlyContinue
if($ar.count -lt 1){
New-Alias g git
}
#endregion Aliases
$ohMyPoshConfigOriginal = 'C:\Apps\powershell\prompt\oh-my-config.json'
$ohMyPoshConfig = "$env:USERPROFILE\oh-my-config.json"
try {
if (Test-Path $ohMyPoshConfig) {
$bak = "$ohMyPoshConfig.bak"
if (Test-Path $bak) {
Remove-Item $bak -Force
}
Copy-Item $ohMyPoshConfigOriginal $bak -Force
Remove-Item $ohMyPoshConfig -Force
}
Copy-Item $ohMyPoshConfigOriginal $ohMyPoshConfig -Force
}
catch {
Write-Warning "Unable to write oh-my-posh profile to $ohMyPoshConfig -- $($_)"
}
oh-my-posh init powershell --config $ohMyPoshConfig | Invoke-Expression
if (Get-Module Terminal-Icons -ListAvailable) {
Import-Module Terminal-Icons
}
if (Get-Module z -ListAvailable) {
Import-Module z
}
#region PSReadLine
Set-PSReadLineOption -PredictionSource History -PredictionViewStyle ListView -Colors @{ InlinePrediction = '#00aa00'} -EditMode Windows
#endregion PSReadLine