Skip to content

Using module statement doesn't work with ScriptsToProcess #2962

@juneb

Description

@juneb

Steps to reproduce

  1. Define PowerShell classes in a script module.
  2. Write a test script, Write-Hello.ps1, that returns "Hello World"
  3. At the command line, use the Using module statement to import the script module.

Expected behavior

The classes in the script module are imported into and available in the caller's session.

Actual behavior

The classes in the script module are NOT imported into and available in the caller's session.
If you comment out the ScriptsToProcess key, the classes are correctly imported into the session.

Environment data

PS C:\Program Files\PowerShell\6.0.0.14> $PSVersionTable

Name Value


PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
SerializationVersion 1.1.0.1
PSEdition Core
BuildVersion 3.0.0.0
CLRVersion
PSRemotingProtocolVersion 2.3
GitCommitId v6.0.0-alpha.14
WSManStackVersion 3.0
PSVersion 6.0.0-alpha

Metadata

Metadata

Assignees

No one assigned

    Labels

    KeepOpenThe bot will ignore these and not auto-closeWG-Enginecore PowerShell engine, interpreter, and runtime

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions