PowerShell_Scripts/Get-PossibleArguments.ps1
lksz 06052cfa29 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
2020-09-18 15:56:40 -04:00

13 строки
413 Б
PowerShell

[CmdletBinding()]param(
[string]$WordToComplete,
[string[]]$FullValueSet,
[switch]$Strict
)
$local:possibleValues = $fullValueSet
if( $wordToComplete ) {
$possibleValues = $possibleValues | Where-Object { $_ -match $wordToComplete }
if( -not $strict -and ($wordToComplete -notin $possibleValues) ) {
$possibleValues = $( $wordToComplete; $possibleValues )
}
}
return $possibleValues