]> apps.delaporte.us Git - dotfiles.git/blobdiff - Microsoft.PowerShell_profile.ps1
Tweak for Win vs Pi
[dotfiles.git] / Microsoft.PowerShell_profile.ps1
index 3f55ac02da3d760f7b554de0ba7deabac1e34d6f..7f228624c3a2529febeeda966821165986b1e19f 100644 (file)
@@ -8,10 +8,11 @@
 #}
 # $env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'')
 
-if($IsWindows -eq "") {
-       # Bootstrap for older PowerShell
-       $IsWindows = ($env:OS -eq "Windows_NT")
-}
+# No longer needed in PowerShell 7
+# if($IsWindows -eq "") {
+#      # Bootstrap for older PowerShell
+#      $IsWindows = ($env:OS -eq "Windows_NT")
+# }
 
 #if($IsWindows){
 #      # Some Paths that are annoying to find/restore if the installer fails
@@ -21,10 +22,17 @@ if($IsWindows -eq "") {
 #      $ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in.
 #}
 
-# Import some home grown PowerShell modules, if they are installed.
+$env:Journal = "~\Journal\2021" # allows cd $env:journal
+
+$src = "~"
+if($IsWindows){
+  $src = "c:\src"
+}
 
-$modPaths = Get-Childitem -Path "c:\src\dotfiles\psmodules"
-$modPaths += Get-Childitem -Path "c:\src\minion\psmodule"
+# Import some home grown PowerShell modules, if they are installed.
+#
+$modPaths = Get-Childitem -Path "$src\dotfiles\psmodules"
+$modPaths += Get-Childitem -Path "$src\minion\psmodule"
 if($modPaths.length -eq 0){
        Write-Host "No modules found."
 }
@@ -33,8 +41,8 @@ $modPaths | ForEach-Object {
        Import-Module $fileName
        Write-Host ">> Loaded $fileName"
 }
-#}
-# $env:PSModulePath = $env:PSModulePath + ";c:\src\dotfiles\psmodules"
+
+# $env:PSModulePath = $env:PSModulePath + ";$src\dotfiles\psmodules"
 
 
 # Linux-like up/down in shell
@@ -42,8 +50,11 @@ Set-PSReadlineKeyHandler -Key UpArrow -Function HistorySearchBackward
 Set-PSReadlineKeyHandler -Key DownArrow -Function HistorySearchForward 
 Set-PSReadlineOption -HistorySavePath c:\temp\PSHistory.log
 
-# Minion commands - 'today'
-. C:\src\minion\profiles\alias.ps1
+# Minion alias commands - 'today'
+. $src\minion\profiles\alias.ps1
+# Add Minion to path
+Write-Host "+ Added minion command to path."
+$ENV:PATH+=";$src\minion\go" # Flag to ensure my profile kicked in.
 
 # Unix dies hard.
 New-Alias which get-command
@@ -57,5 +68,5 @@ Write-Host "+ Type 'pg' to enable PoshGit"
 
 
 if((Get-Location).Path -eq $HOME){
-       cd c:\src
+       cd $src
 }