function MyCompleter{
New-CompletionResult -CompletionText First
New-CompletionResult -CompletionText Second
}
Register-ArgumentCompleter -Native -CommandName echoargs.exe -ScriptBlock $function:MyCompleter
Error:
PSMessageDetails :
Exception : System.Management.Automation.RuntimeException: Method invocation failed because
[System.Management.Automation.Language.FunctionDefinitionAst] does not contain
a method named 'GetScriptBlock'.
vid CallSite.Target(Closure , CallSite , Object )
vid Register-ArgumentCompleter(Closure , FunctionContext )
TargetObject :
CategoryInfo : InvalidOperation: (:) [], RuntimeException
FullyQualifiedErrorId : MethodNotFound
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at Register-ArgumentCompleter, C:\Users\Staffan\Documents\WindowsPowerShell\Mod
ules\TabExpansion++\TabExpansion++.psm1: line 393
at , : line 6
PipelineIterationInfo : {}
Error: