]> apps.delaporte.us Git - dotfiles.git/blob - Microsoft.PowerShell_profile.ps1
Easier to find path for windows.
[dotfiles.git] / Microsoft.PowerShell_profile.ps1
1 # .EXAMPLE
2 # . C:\src\dotfiles\Microsoft.PowerShell_profile.ps1
3
4 Import-Module posh-git
5 # Courtesty of MKletz
6 # Get-ChildItem -Path 'C:\Repos' -Filter "*.psd1" -Recurse | ForEach-Object -Process {
7 # $Path = Split-Path -Path $_.Directory -Parent
8 # $env:PSModulePath = $env:PSModulePath + ";$($Path)"
9 #}
10 $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'')
11
12 if($IsWindows -eq "") {
13 # Bootstrap for older PowerShell
14 $IsWindows = ($env:OS -eq "Windows_NT")
15 }
16 if($IsWindows){
17 # Some Paths that are annoying to find/restore if the installer fails
18 $ENV:PATH+=";C:\Program Files\Microsoft VS Code\bin" # One Editor to rule them all
19 $ENV:PATH+=";C:\Program Files\Git\cmd" # Version control is nice.
20 $ENV:PATH+=";C:\ProgramData\chocolatey\bin" # Package management is nice.
21 $ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in.
22 }
23
24 # Import some home grown PowerShell modules, if they are installed.
25 $modPaths = @("C:\src\dotfiles\ToyBox\toybox.psm1")
26 $modPaths | ForEach-Object {
27 $_ | Format-Table
28 if(Test-Path -Path $_) {
29 Import-Module $_
30 Write-Host "Loaded $_"
31 }
32 }
33
34 # Linux-like up/down in shell
35 Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
36 Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
37 Set-PSReadlineOption -HistorySavePath c:\temp\PSHistory.log
38
39 # Minion commands - 'today'
40 . C:\src\minion\profiles\alias.ps1
41
42 # Unix dies hard.
43 New-Alias which get-command
44
45 # cd c:\src