Skip to content

Verbose output on function exported but isn't actually exported (nor intended to be exported) from script module #8740

@SteveL-MSFT

Description

@SteveL-MSFT

Steps to reproduce

New-ModuleManifest -Path ./noexport.psd1 -RootModule noexport.psm1 -FunctionsToExport @()
 "function test-notExported {}" > noexport.psm1
ipmo ./noexport.psd1 -verbose

Expected behavior

VERBOSE: Loading module from path '/Users/steve/test/Modules/noexport/noexport.psd1'.
VERBOSE: Loading module from path '/Users/steve/test/Modules/noexport/noexport.psm1'.

Actual behavior

VERBOSE: Loading module from path '/Users/steve/test/Modules/noexport/noexport.psd1'.
VERBOSE: Loading module from path '/Users/steve/test/Modules/noexport/noexport.psm1'.
VERBOSE: Exporting function 'test-notExported'.

Note that the function isn't actually exported, seems like the verbose message is in the wrong place in the code.

Environment data

Name                           Value
----                           -----
PSVersion                      6.2.0-preview.3
PSEdition                      Core
GitCommitId                    6.2.0-preview.3
OS                             Darwin 18.2.0 Darwin Kernel Version 18.2.0: Mon Nov 12 20:24:46 PST 2018; root:xnu-4903.231.4~2/RELEASE_X86_64
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Committee-ReviewedPS-Committee has reviewed this and made a decisionIssue-Discussionthe issue may not have a clear classification yet. The issue may generate an RFC or may be reclassifResolution-No ActivityIssue has had no activity for 6 months or moreUp-for-GrabsUp-for-grabs issues are not high priorities, and may be opportunities for external contributorsWG-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