2020-09-30 04:14:51 +00:00
|
|
|
class FunctionName { #: System.Management.Automation.IValidateSetValuesGenerator {
|
2020-09-18 19:41:58 +00:00
|
|
|
static [string[]] _GetValidValues([string]$wordToComplete,[bool]$Strict) {
|
2021-04-27 16:04:12 +00:00
|
|
|
$local:possibleValues = Get-Command -ListImported -Type Function | Select-Object -ExpandProperty Name
|
2020-09-18 19:41:58 +00:00
|
|
|
return $(Get-PossibleArguments -WordToComplete $wordToComplete -FullValueSet $possibleValues -Strict:$Strict );
|
|
|
|
}
|
|
|
|
static [String[]] _GetValidValues([string]$wordToComplete,[switch]$Strict) {
|
2021-04-27 16:04:12 +00:00
|
|
|
return $(Get-PossibleArguments -WordToComplete $wordToComplete -FullValueSet $(Get-Command -ListImported -Type Function | Select-Object -ExpandProperty Name) -Strict:$Strict)
|
2020-09-18 19:41:58 +00:00
|
|
|
# $local:possibleValues =
|
|
|
|
# if( $wordToComplete ) {
|
|
|
|
# $possibleValues = $possibleValues | Where-Object { $_ -match $wordToComplete }
|
|
|
|
# if( -not $strict -and ($wordToComplete -notin $possibleValues) ) {
|
|
|
|
# $possibleValues = $( $wordToComplete; $possibleValues )
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
# return $possibleValues
|
|
|
|
}
|
|
|
|
|
|
|
|
[String[]] GetValidValues() {
|
|
|
|
return [FunctionName]::_GetValidValues('',$true)
|
|
|
|
}
|
|
|
|
}
|