When I hit Tab at a partial UNC path I get an exception in "CompleteInput" and expansion doesn't work:
> gci //pnjnas/p/photos/class*
Directory: C:\Users\steph
Mode LastWriteTime Length Name
---- ------------- ------ ----
d---- 2020-04-19 21:20 1 classées
> gci //pnjnas/p/photos/classAn exception occurred in custom key handler, see $error for more information: Exception calling "CompleteInput" with "3" argument(s): "Object reference not set to an instance of an object."
> $error[0] | select *
PSMessageDetails :
Exception : System.Management.Automation.MethodInvocationException: Exception calling "CompleteInput" with
"3" argument(s): "Object reference not set to an instance of an object."
---> System.NullReferenceException: Object reference not set to an instance of an object.
at
System.Management.Automation.CompletionCompleters.InvokeScriptArgumentCompleter(ScriptBlock
scriptBlock, Object[] argumentsToCompleter, List`1 result)
at
System.Management.Automation.CompletionCompleters.InvokeScriptArgumentCompleter(ScriptBlock
scriptBlock, String commandName, String parameterName, String wordToComplete, CommandAst
commandAst, CompletionContext context, List`1 resultList)
at System.Management.Automation.CompletionCompleters.NativeCommandArgumentCompletion(String
commandName, CompiledCommandParameter parameter, List`1 result, CommandAst commandAst,
CompletionContext context, Dictionary`2 boundArguments)
at System.Management.Automation.CompletionCompleters.ProcessParameter(String commandName,
CommandAst commandAst, CompletionContext context, List`1 result,
MergedCompiledCommandParameter parameter, Dictionary`2 boundArguments)
at System.Management.Automation.CompletionCompleters.GetArgumentCompletionResultsWithSuccess
fulPseudoBinding(CompletionContext context, ArgumentLocation argLocation, CommandAst
commandAst)
at
System.Management.Automation.CompletionCompleters.CompleteCommandArgument(CompletionContext
context)
at System.Management.Automation.CompletionAnalysis.GetResultForIdentifier(CompletionContext
completionContext, Int32& replacementIndex, Int32& replacementLength, Boolean isQuotedString)
at System.Management.Automation.CompletionAnalysis.GetResultHelper(CompletionContext
completionContext, Int32& replacementIndex, Int32& replacementLength, Boolean isQuotedString)
at System.Management.Automation.CompletionAnalysis.GetResults(PowerShell powerShell, Int32&
replacementIndex, Int32& replacementLength)
at System.Management.Automation.CommandCompletion.CompleteInputImpl(Ast ast, Token[]
tokens, IScriptPosition positionOfCursor, Hashtable options)
at System.Management.Automation.CommandCompletion.CompleteInput(String input, Int32
cursorIndex, Hashtable options)
at CallSite.Target(Closure , CallSite , Type , String , Int32 , Hashtable )
--- End of inner exception stack trace ---
at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext
funcContext, Exception exception)
at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at
System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame
frame)
at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object
dollarUnderbar, Object inputToProcess)
at System.Management.Automation.CommandProcessorBase.Complete()
TargetObject :
CategoryInfo : NotSpecified: (:) [], MethodInvocationException
FullyQualifiedErrorId : NullReferenceException
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock><End>, <No file>: line 38
at Invoke-GuiCompletion,
C:\Users\steph\OneDrive\Documents\PowerShell\Modules\GuiCompletion\0.8.1\GuiCompletion.psm1:
line 22
at <ScriptBlock>,
C:\Users\steph\OneDrive\Documents\PowerShell\Modules\GuiCompletion\0.8.1\GuiCompletion.psm1:
line 8
at PSConsoleHostReadLine,
C:\Users\steph\OneDrive\Documents\PowerShell\Modules\PSReadLine\2.0.0\PSReadLine.psm1: line 4
PipelineIterationInfo : {}
I'm running 0.8.1, with PSReadLine 2.0.0. Issue occurs both in Windows PowerShell 5.1 and PowerShell 7.0.
> ls c:/nomatchAn exception occurred in custom key handler, see $error for more information: Exception calling "CompleteInput" with "3" argument(s): "Object reference not set to an instance of an object."