-
Notifications
You must be signed in to change notification settings - Fork 1
/
Microsoft.PowerShell_profile.ps1
99 lines (90 loc) · 2.86 KB
/
Microsoft.PowerShell_profile.ps1
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
Import-Module posh-git
#Import-Module oh-my-posh
#oh-my-posh init pwsh | Invoke-Expression
Import-Module -Name Terminal-Icons
#Set-Theme Paradox
oh-my-posh init pwsh --config "E:\Rezervna Kopija\Documents\Projects\powershell\luka.omp.json" | Invoke-Expression
Set-PSReadLineOption -PredictionSource History
Set-PSReadLineOption -PredictionViewStyle ListView
Set-PSReadLineOption -EditMode Windows
Set-PSReadLineOption -Colors @{ InlinePrediction = '#124373'}
Set-Alias -name die -value git
Set-Alias -name man -value Get-Help
Set-Alias -name bottom -value btm
Set-Alias -name pusimiga -value pushimiga
Set-Alias -name aria2 -value aria2c
Set-Alias -name aria -value aria2c
Set-Alias -name gitfetchall -value gfa
Set-Alias -name gitpullall -value gpa
Set-Alias -name lg -value lazygit
Set-Alias -name gqs -value git-quick-stats
Set-Alias -name gb -value git-branchless
Set-Alias -name gom -value gitomatic
function pushimiga { git push }
function gs { git status }
function gf { git fetch --all }
function wingetupgrade {
$cmd = ""
$args = $args | ?{$_ -ne ""}
foreach ($arg in $args) {
$cmd += "winget upgrade $arg; "
}
Invoke-Expression $cmd
}
function clonerepos {
$cmd = ""
$args = $args | ?{$_ -ne ""}
foreach ($arg in $args) {
$cmd += "gh repo clone $arg; "
$cmd += "echo '**************************************************';"
}
Invoke-Expression $cmd
}
function gfa {
$currentDirectory = Get-Location
Get-ChildItem -Directory | ForEach-Object {
Write-Host "**************************************************"
Write-Host "->Fetching $($_.Name)"
Set-Location $_.FullName
if (Test-Path .git) {
git fetch
} else {
Write-Host "No git repository found in $($_.Name)"
}
}
Set-Location $currentDirectory
}
function gpa {
$currentDirectory = Get-Location
Get-ChildItem -Directory | ForEach-Object {
Write-Host "**************************************************"
Write-Host "->Pulling $($_.Name)"
Set-Location $_.FullName
if (Test-Path .git) {
git pull
} else {
Write-Host "No git repository found in $($_.Name)"
}
}
Set-Location $currentDirectory
}
function mklink ($link, $target) {
New-Item -Path $link -ItemType SymbolicLink -Value $target
}
function time {
$cmd = ""
$args = $args | ?{$_ -ne ""}
foreach ($arg in $args) {
$cmd += "Measure-Command {start-process $arg -Wait}; "
}
Invoke-Expression $cmd
}
# Import the Chocolatey Profile that contains the necessary code to enable
# tab-completions to function for `choco`.
# Be aware that if you are missing these lines from your profile, tab completion
# for `choco` will not function.
# See https://ch0.co/tab-completion for details.
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
if (Test-Path($ChocolateyProfile)) {
Import-Module "$ChocolateyProfile"
}