Modify Setup, Path, added Get-MyModules

+ base/Get-MyModules added
* base/profile.d/Test-MyModules modified to use Get-MyModules
* Setup-Profile modified so that sudo witll preserve environment
* Get-Path fixed bug introduced in last commit, Get-Path would fail when
  file to be edited didn't exist
This commit is contained in:
lksz 2021-02-19 19:22:46 -05:00
parent 5dae2a2af5
commit 6d2a23ae04
4 changed files with 41 additions and 25 deletions

View file

@ -22,7 +22,7 @@ process {
'~' {
if( $p -match '^~[^/]*' ) {
$local:m = $Matches[0]
$p = $p -replace "^$m",((Get-Item $m).FullName)
$p = $p -replace "^$m",((Get-Item -Force $m).FullName)
}
}
}
@ -34,7 +34,13 @@ process {
}
if( $Expand ) {
$p = $p | Get-Item | Select-Object -ExpandProperty FullName
$p = $p | ForEach-Object {
if( Test-Path $p ) {
$p | Get-Item -Force | Select-Object -ExpandProperty FullName
} else {
$p
}
}
}
$p