1
1
2
+ if (! (Get-Command Test-Elevated - ea SilentlyContinue))
3
+ {
4
+ Write-Host " *** Ensure $PSScriptRoot \Modules\Scripts is in your system env PATH" - ForegroundColor Red
5
+ Write-Host " *** temporarily setting path" - ForegroundColor DarkGray
6
+ $env: PATH += " $PSScriptRoot \Modules\Scripts"
7
+ }
8
+
2
9
$env: PSElevated = Test-Elevated
3
10
4
- # override the prompt function
11
+ # override the prompt function; this is the default prompt before using OhMyPosh
5
12
function prompt {
6
13
$saveCode = $LASTEXITCODE
7
14
if ($env: PSElevated -eq $true ) {
@@ -16,27 +23,6 @@ function prompt {
16
23
return " > "
17
24
}
18
25
19
-
20
- # Aliases
21
-
22
- New-Alias ep Edit-PSProfile
23
- New-Alias vs Set-VsDevEnv
24
- New-Alias push Push-Location
25
- New-Alias pop Pop-Location
26
- New-Alias rbh Remove-BrowserHijack
27
-
28
- $0 = ' C:\Github\ClipboardViewer\bin\Debug\ClipboardViewer.exe'
29
- if (Test-Path $0 )
30
- {
31
- function Start-ClipboardViewer
32
- {
33
- [CmdletBinding ()]
34
- [Alias (" cv" )]
35
- param ($p1 , $p2 , $p3 , $p4 )
36
- & $0 $p1 $p2 $p3 $p4
37
- }
38
- }
39
-
40
26
function Push-PSRoot
41
27
{
42
28
[CmdletBinding ()]
@@ -53,12 +39,6 @@ function Stop-Edge
53
39
taskkill / f / im msedge.exe
54
40
}
55
41
56
- . $PSScriptRoot \Modules\Scripts\Set-OutDefaultOverride.ps1
57
- Set-Alias ls Get-ChildItemColorized - Force - Option AllScope
58
-
59
- # curl.exe is installed as a choco package to \system32; ensure no alias
60
- Remove-Item alias:curl - ErrorAction SilentlyContinue
61
-
62
42
function Start-Wilma
63
43
{
64
44
[CmdletBinding ()]
@@ -67,13 +47,38 @@ function Start-Wilma
67
47
& ' C:\Tools\WiLMa\WinLayoutManager.exe'
68
48
}
69
49
70
- New-Alias hx Get-HistoryEx
71
- New-Alias Clear-History Clear-HistoryEx
50
+ $0 = ' C:\Github\ClipboardViewer\bin\Debug\ClipboardViewer.exe'
51
+ if (Test-Path $0 )
52
+ {
53
+ function Start-ClipboardViewer
54
+ {
55
+ [CmdletBinding ()]
56
+ [Alias (" cv" )]
57
+ param ($p1 , $p2 , $p3 , $p4 )
58
+ & $0 $p1 $p2 $p3 $p4
59
+ }
60
+ }
61
+
62
+ # Command aliases...
63
+
64
+ . $PSScriptRoot \Modules\Scripts\Set-OutDefaultOverride.ps1
65
+ Set-Alias ls Get-ChildItemColorized - Force - Option AllScope
66
+
67
+ New-Alias Clear-History Clear-HistoryEx - ea SilentlyContinue
68
+ New-Alias ep Edit-PSProfile - ea SilentlyContinue
69
+ New-Alias hx Get-HistoryEx - ea SilentlyContinue
70
+ New-Alias pop Pop-Location - ea SilentlyContinue
71
+ New-Alias push Push-Location - ea SilentlyContinue
72
+ New-Alias rbh Remove-BrowserHijack - ea SilentlyContinue
73
+ New-Alias vs Set-VsDevEnv - ea SilentlyContinue
72
74
73
75
# Docker helpers
74
- New-Alias doc Remove-DockerTrash
75
- New-Alias dos Show-Docker
76
- New-Alias dow Start-DockerForWindows
76
+ New-Alias doc Remove-DockerTrash - ea SilentlyContinue
77
+ New-Alias dos Show-Docker - ea SilentlyContinue
78
+ New-Alias dow Start-DockerForWindows - ea SilentlyContinue
79
+
80
+ # curl.exe is installed as a choco package to \system32; ensure no alias
81
+ Remove-Item alias:curl - ErrorAction SilentlyContinue
77
82
78
83
# OK, Go!
79
84
@@ -98,9 +103,7 @@ $cmd = (Get-CimInstance win32_process -filter ("ProcessID={0}" -f `
98
103
99
104
if ($cmd -notmatch ' cmd\.exe' )
100
105
{
101
- if (Test-Path ' D:\scp' ) { Set-Location ' D:\scp' ; }
102
- elseif (Test-Path ' D:\Github' ) { Set-Location ' D:\Github' ; }
103
- elseif (Test-Path ' C:\Github' ) { Set-Location ' C:\Github' ; }
106
+ if (Test-Path ' C:\Github' ) { Set-Location ' C:\Github' ; }
104
107
elseif (Test-Path ' C:\Code' ) { Set-Location ' C:\Code' ; }
105
108
elseif (Test-Path ' C:\River' ) { Set-Location ' C:\River' ; }
106
109
else { Set-Location ' \' ; }
0 commit comments