-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPSProfile.ps1
More file actions
40 lines (37 loc) · 2.49 KB
/
PSProfile.ps1
File metadata and controls
40 lines (37 loc) · 2.49 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
Import-Module -Name Terminal-Icons
$OMPProfile = "$env:USERPROFILE\Git\TerminalConfiguration\ADJ.omp.json"
if (!(Test-Path -Path $OMPProfile)) {
Invoke-WebRequest -UseBasicParsing -Uri 'https://raw.githubusercontent.com/AlCpwnd/TerminalConfiguration/main/ADJ.omp.json' -OutFile $OMPProfile
}
oh-my-posh init pwsh --config $OMPProfile | Invoke-Expression
function Get-GitChanges {
$Folders = Get-ChildItem -Directory
$UiColor = $Host.UI.RawUI
$WindowWidth = $Host.UI.RawUI.WindowSize.Width
foreach ($Folder in $Folders) {
Write-Host ""
$Spaces = " " * ($WindowWidth - ($Folder.Name.Length + 2))
Write-Host "> $($Folder.Name)$Spaces" -BackgroundColor $UiColor.ForegroundColor -ForegroundColor $UiColor.BackgroundColor
Push-Location $Folder.FullName
& git pull
Pop-Location
}
}
$Aliases = @(
@{
Alias = 'GGC'
Value = 'Get-GitChanges'
},
@{
Alias = '7z'
Value = 'C:\Program Files\7-Zip\7z.exe'
}
)
foreach ($Alias in $Aliases) {
try {
Get-Alias -Name $Alias.Alias -ErrorAction Stop | Out-Null
}
catch {
New-Alias -Name $Alias.Alias -Value $Alias.Value -ErrorAction SilentlyContinue
}
}