]> us-delaporte.pagekite.me Git - dotfiles.git/blob - Microsoft.PowerShell_profile.ps1
Typo fixes.
[dotfiles.git] / Microsoft.PowerShell_profile.ps1
1 # .EXAMPLE
2 # . C:\src\dotfiles\Microsoft.PowerShell_profile.ps1
3
4 # Courtesty of MKletz
5 # Get-ChildItem -Path 'C:\Repos' -Filter "*.psd1" -Recurse | ForEach-Object -Process {
6 # $Path = Split-Path -Path $_.Directory -Parent
7 # $env:PSModulePath = $env:PSModulePath + ";$($Path)"
8 #}
9 # $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'')
10
11 if($IsWindows -eq "") {
12 # Bootstrap for older PowerShell
13 $IsWindows = ($env:OS -eq "Windows_NT")
14 }
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
26 $modPaths = Get-Childitem -Path "c:\src\dotfiles\psmodules"
27 $modPaths += Get-Childitem -Path "c:\src\minion\psmodule"
28 if($modPaths.length -eq 0){
29 Write-Host "No modules found."
30 }
31 $modPaths | ForEach-Object {
32 $fileName = $_.FullName
33 Import-Module $fileName
34 Write-Host ">> Loaded $fileName"
35 }
36 #}
37 # $env:PSModulePath = $env:PSModulePath + ";c:\src\dotfiles\psmodules"
38
39
40 # Linux-like up/down in shell
41 Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
42 Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
43 Set-PSReadlineOption -HistorySavePath c:\temp\PSHistory.log
44
45 # Minion alias commands - 'today'
46 . C:\src\minion\profiles\alias.ps1
47 # Add Minion to path
48 Write-Host "+ Added minion command to path."
49 $ENV:PATH+=";c:\src\minion\go" # Flag to ensure my profile kicked in.
50
51 # Unix dies hard.
52 New-Alias which get-command
53
54 # Delay loading PoshGit for speed.
55 function Enable-PoshGit {
56 Import-Module posh-git
57 }
58 New-Alias pg Enable-PoshGit
59 Write-Host "+ Type 'pg' to enable PoshGit"
60
61
62 if((Get-Location).Path -eq $HOME){
63 cd c:\src
64 }