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 if($IsWindows -eq "") {
12 # Bootstrap for older PowerShell
13 $IsWindows = ($env:OS -eq "Windows_NT")
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.
24 # Import some home grown PowerShell modules, if they are installed.
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."
31 $modPaths | ForEach-Object {
32 $fileName = $_.FullName
33 Import-Module $fileName
34 Write-Host ">> Loaded $fileName"
37 # $env:PSModulePath = $env:PSModulePath + ";c:\src\dotfiles\psmodules"
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
45 # Minion alias commands - 'today'
46 . C:\src\minion\profiles\alias.ps1
48 Write-Host "+ Added minion command to path."
49 $ENV:PATH+=";c:\src\minion\go" # Flag to ensure my profile kicked in.
52 New-Alias which get-command
54 # Delay loading PoshGit for speed.
55 function Enable-PoshGit {
56 Import-Module posh-git
58 New-Alias pg Enable-PoshGit
59 Write-Host "+ Type 'pg' to enable PoshGit"
62 if((Get-Location).Path -eq $HOME){