-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy path.profile.ps1
46 lines (38 loc) · 1.21 KB
/
.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
###############################################################################
# powershell initialization script
# call from profile.ps1, like this:
# . "$env:HOME\.profile.ps1"
# (notice the '.')
###############################################################################
#
# Set the $HOME variable for our use
# and make powershell recognize ~\ as $HOME
# in paths
#
set-variable -name HOME -value (resolve-path $env:Home).Path -force
(get-psprovider FileSystem).Home = $HOME
#
# global variables and core env variables
#
$HOME_ROOT = [IO.Path]::GetPathRoot($HOME)
$TOOLS = "$HOME_ROOT\tools"
$SCRIPTS = "$HOME\scripts"
$env:EDITOR = 'nvim.exe'
#
# set path to include my usual directories
# and configure dev environment
#
function script:Append-Path([string] $path ) {
if ( -not [string]::IsNullOrEmpty($path) ) {
if ( (test-path $path) -and (-not $env:PATH.contains($path)) ) {
$env:PATH += ';' + $path
}
}
}
append-path "$TOOLS"
append-path "$TOOLS\vim"
append-path "$($env:WINDIR)\system32\inetsrv"
Import-Module ~/scripts/DevEnvironment
Set-DevEnvironment 17
. ~/scripts/Set-Prompt.ps1
Import-Module ~/scripts/ProfileUtils.psm1 -Scope Global