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
15
profile.d/MyScript.class.ps1
Normal file
15
profile.d/MyScript.class.ps1
Normal file
|
@ -0,0 +1,15 @@
|
|||
class MyScript : System.Management.Automation.IValidateSetValuesGenerator {
|
||||
static [string[]] _GetValidValues([string]$wordToComplete,[bool]$Strict) {
|
||||
$local:possibleValues = $(
|
||||
Get-ChildItem $global:MyPSScriptRoot -Filter '*.ps1' -Recurse |
|
||||
Select-Object -ExpandProperty FullName | ForEach-Object {
|
||||
$_ -replace '\.ps1$','' -replace "$($MyPSScriptRoot -replace '\\',"\\")[/\\]",''
|
||||
}
|
||||
)
|
||||
return $(Get-PossibleArguments -WordToComplete $wordToComplete -FullValueSet $possibleValues -Strict:$Strict );
|
||||
}
|
||||
|
||||
[String[]] GetValidValues() {
|
||||
return [MyScript]::_GetValidValues('',$true)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue