2 # . C:\src\dotfiles\Microsoft.PowerShell_profile.ps1
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)"
9 # $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'')
11 # No longer needed in PowerShell 7
12 # if($IsWindows -eq "") {
13 # # Bootstrap for older PowerShell
14 # $IsWindows = ($env:OS -eq "Windows_NT")
18 # # Some Paths that are annoying to find/restore if the installer fails
19 # $ENV:PATH+=";C:\Program Files\Microsoft VS Code\bin" # One Editor to rule them all
20 # $ENV:PATH+=";C:\Program Files\Git\cmd" # Version control is nice.
21 # $ENV:PATH+=";C:\ProgramData\chocolatey\bin" # Package management is nice.
22 # $ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in.
25 $env:Journal = "~\Journal\2021" # allows cd $env:journal
32 # Import some home grown PowerShell modules, if they are installed.
34 $modPaths = Get-Childitem -Path "$src\dotfiles\psmodules"
35 $modPaths += Get-Childitem -Path "$src\minion\psmodule"
36 if($modPaths.length -eq 0){
37 Write-Host "No modules found."
39 $modPaths | ForEach-Object {
40 $fileName = $_.FullName
41 Import-Module $fileName
42 Write-Host ">> Loaded $fileName"
45 # $env:PSModulePath = $env:PSModulePath + ";$src\dotfiles\psmodules"
48 # Linux-like up/down in shell
49 Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
50 Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward
51 Set-PSReadlineOption -HistorySavePath c:\temp\PSHistory.log
53 # Minion alias commands - 'today'
54 . $src\minion\profiles\alias.ps1
56 Write-Host "+ Added minion command to path."
57 $ENV:PATH+=";$src\minion\go" # Flag to ensure my profile kicked in.
60 New-Alias which get-command
62 # Delay loading PoshGit for speed.
63 function Enable-PoshGit {
64 Import-Module posh-git
66 New-Alias pg Enable-PoshGit
67 Write-Host "+ Type 'pg' to enable PoshGit"
70 if((Get-Location).Path -eq $HOME){