Added a call to Reload-MyAliases

This commit is contained in:
lksz 2020-09-16 15:24:19 -04:00
parent bfb2e38cc0
commit bb2488e591
1 changed files with 10 additions and 1 deletions

View File

@ -8,7 +8,14 @@ They are provided 'as is' for your review and for your reuse.
There is a [blog post](https://blog.lksz.me/keeping-track-of-everything/#-mypsscriptroot) about how to clone this repo and use it as your own.
The scripts all [assume](https://blog.lksz.me/functions-or-scripts/#myprofilecode) the following code is part of one of your $PROFILE files:
The scripts all [assume](https://blog.lksz.me/functions-or-scripts/#myprofilecode) the code below is part of one of your $PROFILE files.
The code establishes the following variables:
* `$PathEnvDelimiter` - Linux/Unix it's `:`, while in Windows it's `;`
* `$MyPSModulePath` - Location to place personal Modules
* `$MyPSScrtipRoot` - Location of personal Scripts.
The code also makes sure `$MyPSScriptRoot` is in the `$env:PATH` environment vairable, and finally it calls [`Reload-MyAliases`](https://blog.lksz.me/a-case-of-sensitivity/#myaliases) if it exists.
```
$global:PathEnvDelimiter = $(if( $PSVersionTable.Platform -match 'unix' ) {':'} else {';'})
function Split-PathEnv {
@ -34,4 +41,6 @@ if( -not (Test-Path $MyPSScrtipRoot) ) {
$p = @($p[0], $MyPSScrtipRoot) + $($p | Select-Object -Skip 1)
$env:PATH = $p -join $PathEnvDelimiter
Get-Command Reload-MyAliases -ErrorAction SilentlyContinue | ForEach-Object { Reload-MyAliases }
```