Last active
November 21, 2023 06:32
-
-
Save amigus/26cfb6cc8578ef783668c0b9346bd26c to your computer and use it in GitHub Desktop.
My PowerShell Profile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# My $PROFILE; https://gist.github.com/amigus/26cfb6cc8578ef783668c0b9346bd26c #> | |
| $ConfigDirectory = Get-Item $PROFILE | Select-Object -ExpandProperty DirectoryName | |
| #region $env:Path | |
| <# | |
| The PSPaths.ps1 file is a list of expressions that evaluate to folder names e.g. | |
| $env:USERPROFILE + '\.local\bin' | |
| #> | |
| foreach ($DirectoryExpression in Get-Content "${ConfigDirectory}\PSPaths.ps1") { | |
| $Directory = try { | |
| Get-Item (Invoke-Expression $DirectoryExpression) -ErrorAction SilentlyContinue | |
| } catch { | |
| Get-Item $DirectoryExpression -ErrorAction SilentlyContinue | |
| } | |
| if ($Directory -notin $env:Path.Split([IO.Path]::PathSeparator)) { | |
| $env:Path += [IO.Path]::PathSeparator + $Directory | |
| } | |
| } | |
| #endregion | |
| Set-PSReadLineOption -EditMode Windows -PredictionSource History -HistoryNoDuplicates |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment