22 lines
1.0 KiB
PowerShell
22 lines
1.0 KiB
PowerShell
class FunctionName { #: System.Management.Automation.IValidateSetValuesGenerator {
|
|
static [string[]] _GetValidValues([string]$wordToComplete,[bool]$Strict) {
|
|
$local:possibleValues = Get-Command -Type Function | Select-Object -ExpandProperty Name
|
|
return $(Get-PossibleArguments -WordToComplete $wordToComplete -FullValueSet $possibleValues -Strict:$Strict );
|
|
}
|
|
static [String[]] _GetValidValues([string]$wordToComplete,[switch]$Strict) {
|
|
return $(Get-PossibleArguments -WordToComplete $wordToComplete -FullValueSet $(Get-Command -Type Function | Select-Object -ExpandProperty Name) -Strict:$Strict)
|
|
# $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)
|
|
}
|
|
}
|