-
Notifications
You must be signed in to change notification settings - Fork 0
/
iac-profile.ps1
44 lines (38 loc) · 947 Bytes
/
iac-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
New-Variable -Name PROJECTS -Value 'C:\work\projects' -Option ReadOnly
Set-Variable -Name HOME -Value 'C:\work' -Force
Set-Location $HOME
Import-Module PSReadLine
Import-Module posh-git
Set-Alias -Name gh -Value Get-Help
Set-Alias -Name uh -Value Update-Help
Set-Alias -Name rdir -Value Remove-Directory -Option AllScope
Set-Alias -Name ndir -Value New-Directory -Option AllScope
Set-Alias -Name home -Value Set-Home -Option AllScope
function Open-Profile {
code $profile.CurrentUserAllHosts
}
function Remove-Directory {
Param(
[Parameter(
Mandatory = $true,
ValueFromPipelineByPropertyName = $true
)]
[String]
$Path
)
Remove-Item -Path $Path -Recurse -Force
}
function New-Directory {
Param(
[Parameter(
Mandatory = $true,
ValueFromPipelineByPropertyName = $true
)]
[String]
$Name
)
New-Item -Name $Name -ItemType Directory
}
function Set-Home {
Set-Location $HOME
}