2020-09-30 04:14:51 +00:00
|
|
|
class MyScript { #: System.Management.Automation.IValidateSetValuesGenerator {
|
2020-09-18 19:41:58 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|