-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMicrosoft.Powershell_profile.ps1
45 lines (42 loc) · 1.25 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
# My Powershell Profile
Import-Module posh-git
Import-Module oh-my-posh
Set-PoshPrompt -Theme hotstick.minimal
Import-Module ~\Documents\Powershell\Get-AndyURLHealthCheck.psm1
Set-PSReadLineOption -PredictionSource History
# Creating some aliases for most commonly used commands
function terraforminit { terraform init }
function terraformvalidate { terraform validate }
function terraformplan { terraform plan }
function terraformapply { terraform apply }
set-alias -Name ti -Value terraforminit
set-alias -Name tv -Value terraformvalidate
set-alias -Name tp -Value terraformplan
set-alias -Name ta -Value terraformapply
set-alias -Name k -Value kubectl
function gitadd {
Param(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true)]
[string[]]
$Path
)
git add $Path
}
function gitstatus { git status }
function gitcommit { git commit -m }
function gitcommit {
Param(
[Parameter(Mandatory = $true,
ValueFromPipeline = $true)]
[string[]]
$CommitMessage
)
git commit -m $CommitMessage
}
function gitpush { git push }
set-alias -Name ga -Value gitadd
set-alias -Name gs -Value gitstatus
set-alias -Name gco -Value gitcommit
set-alias -Name gpu -Value gitpush
Set-Location -Path ~