Reload-MyAliases is now Reload-MyScripts
🔖 https://blog.lksz.me/editing-with-ease/ ✏️ Fixed $MyPSScriptRoot typo ✨ Get-ScopeDepth 🐛 Get-MyAliases didn't work correctly when sub-scoped, fixed the issue 🚚 Reload-MyAliases is now Reload-MyScripts 🐛 Reload-MyScripts loads scripts from $MyPSScriptRoot/profile.d subdir 📝 README updated to reflect change of script name and typo
This commit is contained in:
parent
bb2488e591
commit
06052cfa29
14 changed files with 186 additions and 13 deletions
|
@ -9,17 +9,18 @@ do {
|
|||
try {
|
||||
$local:newAliases += Get-Alias -Scope $_scope |
|
||||
Where-Object {
|
||||
($_.Definition -match "^$MyPSScrtipRoot") -or ($_.Description -match '#MyAlias')
|
||||
($_.Definition -match "^$MyPSScriptRoot") -or ($_.Description -match '#MyAlias')
|
||||
}
|
||||
if( $newAliases ) {
|
||||
$allAliases += $newAliases
|
||||
$MyAliasScope = $_scope;
|
||||
Write-Verbose "`$MyAliasScope is now set to $MyAliasScope"
|
||||
}
|
||||
$_scope += 1
|
||||
} catch {
|
||||
$done = $_.Exception.Message -match 'The scope .* exceeds'
|
||||
Write-Verbose "catch: $($_.Exception.Message)"
|
||||
$_done = $_.Exception.Message -match 'The scope .* exceeds'
|
||||
}
|
||||
} until ( $done )
|
||||
$_scope += 1
|
||||
} until ( $_done )
|
||||
|
||||
$allAliases
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue