PowerShell_Scripts/base/profile.d/FunctionName.class.ps1

22 lines
1.0 KiB
PowerShell
Raw Normal View History

class FunctionName { #: System.Management.Automation.IValidateSetValuesGenerator {
static [string[]] _GetValidValues([string]$wordToComplete,[bool]$Strict) {
$local:possibleValues = Get-Command -ListImported -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 -ListImported -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)
}
}