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

Invoking ConfigInstruction in two different runspaces cases ExceptionInGetEnumerator #11

Open
alx9r opened this issue Nov 26, 2016 · 0 comments

Comments

@alx9r
Copy link
Owner

alx9r commented Nov 26, 2016

Repro

  1. Open ISE
  2. Invoke ConfigInstructions Name {} in the REPL
  3. Open a second REPL tab in ISE.
  4. Invoke ConfigInstructions Name {} in the second REPL tab
  5. The following error is output:
format-default : The following exception occurred while trying to enumerate the collection: "The term 'New-ProgressNodes' is not recognized as the name of a cmdlet, 
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.".
    + CategoryInfo          : NotSpecified: (:) [format-default], ExtendedTypeSystemException
    + FullyQualifiedErrorId : ExceptionInGetEnumerator,Microsoft.PowerShell.Commands.FormatDefaultCommand

Cause

The cause of this error seems to be PowerShell itself. When a module that implements an object that implements IEnumerator is loaded into two runspaces in the same process, then, in the second runspace no functions from the module are available from within .GetEnumerator().

There is a repro of this bug that is independent of ZeroDSC in the ToolFoundations repo.

Affected PowerShell Versions

Versions known to exhibit problem:

  • 5.0.10586.51
  • 5.0.10586.117

Versions known not to exhibit problem:

  • 5.1.14394.1000

Expected Resolution

It looks like PowerShell 5.0 has this problem but 5.1 does not. This issue should remain open until it has been confirmed that the GA version of PowerShell 5.1 indeed ships with this issue resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant