Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerShell not showing correct error #1666

Closed
Al-Mond opened this issue Dec 19, 2018 · 6 comments
Closed

PowerShell not showing correct error #1666

Al-Mond opened this issue Dec 19, 2018 · 6 comments
Labels
Area-PSReadLine Issue-Enhancement A feature request (enhancement).

Comments

@Al-Mond
Copy link

Al-Mond commented Dec 19, 2018

We have written the needed data into your clipboard because it was too large to send. Please paste.

@rjmholt
Copy link
Contributor

rjmholt commented Dec 20, 2018

We have written the needed data into your clipboard because it was too large to send. Please paste.

Not sure what this means.

Can you provide more information?

Please see our troubleshooting docs.

@Al-Mond
Copy link
Author

Al-Mond commented Dec 21, 2018

Sorry, something turned that whole thing into nonsense. Let me write it out again.

This is something I've noticed with the AD modules, but I think I've seen similar posts somewhere (I couldn't find them). If I run this command in VSCode Insiders 1.31.0:

New-ADGroup -Name $deptGrp -Path $grpPath 

There's the error it dumps:

Generic types are not supported for input fields at this time.
At line:1 char:1
+ New-ADGroup -Name $deptGrp -Path $grpPath
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [], RuntimeException
    + FullyQualifiedErrorId : Argument

If I do the same thing in ISE, it prompts me for the other mandatory switch, -groupScope.

@rjmholt
Copy link
Contributor

rjmholt commented Dec 22, 2018

Can you try getting the result of $error[0] | fl * -Force after such a command?

It sounds like you might be experiencing an invocation error that is by design but that PSReadLine and the ISE step in to catch and prompt for more input in some way. What happens when you run this in the PowerShell console (not the Integrated Console and not ISE)

@Al-Mond
Copy link
Author

Al-Mond commented Dec 27, 2018

Here's the output of the $error[0] command:

PSMessageDetails      :
Exception             : System.Management.Automation.RuntimeException: Generic types are not supported for input fields at this time. --->
                        System.Management.Automation.PSArgumentException: Generic types are not supported for input fields at this time.
                           at Microsoft.PowerShell.EditorServices.Console.FieldDetails..ctor(String name, String label, Type fieldType, Boolean
                        isMandatory, Object defaultValue)
                           at Microsoft.PowerShell.EditorServices.Console.FieldDetails.Create(FieldDescription fieldDescription, ILogger logger)
                           at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
                           at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
                           at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
                           at Microsoft.PowerShell.EditorServices.EditorServicesPSHostUserInterface.Prompt(String promptCaption, String
                        promptMessage, Collection`1 fieldDescriptions)
                           at System.Management.Automation.Internal.Host.InternalHostUserInterface.Prompt(String caption, String message,
                        Collection`1 descriptions)
                           at System.Management.Automation.CmdletParameterBinderController.PromptForMissingMandatoryParameters(Collection`1
                        fieldDescriptionList, Collection`1 missingMandatoryParameters)
                           at System.Management.Automation.CmdletParameterBinderController.HandleUnboundMandatoryParameters(Int32
                        validParameterSetCount, Boolean processMissingMandatory, Boolean promptForMandatory, Boolean isPipelineInputExpected,
                        Collection`1& missingMandatoryParameters)
                           at System.Management.Automation.CmdletParameterBinderController.BindCommandLineParameters(Collection`1 arguments)
                           at System.Management.Automation.CommandProcessor.BindCommandLineParameters()
                           at System.Management.Automation.CommandProcessorBase.DoPrepare(IDictionary psDefaultParameterValues)
                           at System.Management.Automation.Internal.PipelineProcessor.Start(Boolean incomingStream)
                           at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input)
                           at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput,
                        CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections,
                        FunctionContext funcContext)
                           at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
                           at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
                           --- End of inner exception stack trace ---
TargetObject          :
CategoryInfo          : InvalidArgument: (:) [], RuntimeException
FullyQualifiedErrorId : Argument
ErrorDetails          :
InvocationInfo        : System.Management.Automation.InvocationInfo
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}

When I open up a PowerShell console and run it, it prompts me for the mandatory parameter GroupScope.

Thanks!

@SydneyhSmith SydneyhSmith added Issue-Enhancement A feature request (enhancement). Area-PSReadLine labels Jan 7, 2019
@rjmholt
Copy link
Contributor

rjmholt commented Jan 8, 2019

When I open up a PowerShell console and run it, it prompts me for the mandatory parameter GroupScope.

Yeah I think PSReadLine is handling this in a user-friendly way. If you do:

> rmo PSReadLine
> New-ADGroup -Name $deptGrp -Path $grpPath 

in a PowerShell console, I'd expect the same error (provided PSReadLine is actually unloaded).

In which case, this might well be fixed by #535, and if not, would be much easier to fix after that's in.

@SydneyhSmith
Copy link
Collaborator

Closing this as PSReadline is now available in the PowerShell Preview extension, will re-open if this doesn't solve the probelm..also tracking the lack of PS Readline in the PowerShell extension with this issue #1793

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-PSReadLine Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

3 participants