Skip to content

Calling Write() with no output throws an exception #814

@kamsar

Description

@kamsar

To reproduce:

  • Implement a basic cmdlet (or hack one that already exists)
  • As the first statement in its implementation call Host.UI.Write("anything")
  • Call the cmdlet

An out of range exception is thrown, due to the array count check here becoming index -1 if the Output has nothing in it yet.

Edge case? Yes. And it was because I was using it wrong anyway ;)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions