2020-11-25 05:46:33 +00:00
|
|
|
class MyScript { #: System.Management.Automation.IValidateSetValuesGenerator {
|
|
|
|
static [string[]] _GetValidValues([string]$wordToComplete,[bool]$CurrentOnly,[bool]$Strict) {
|
|
|
|
$local:possibleValues = $(
|
|
|
|
Get-MyPackages -ReturnFullPath -IncludeRoot -Force:$(-not $CurrentOnly) |
|
2020-12-02 04:31:42 +00:00
|
|
|
Get-ChildItem -Recurse -Filter '*.ps1' |
|
2020-11-25 05:46:33 +00:00
|
|
|
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('',$false,$true)
|
|
|
|
}
|
|
|
|
}
|