GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — NestedModules does not work on Linux if the path starts with '.' e.g. '.\folder\library.dll' · Issue #3693 · PowerShell/PowerShell

NestedModules does not work on Linux if the path starts with '.' e.g. '.\folder\library.dll'  #3693

New issue
Copy link
New issue
Copy link
Closed
#4010
Closed
NestedModules does not work on Linux if the path starts with '.' e.g. '.\folder\library.dll' #3693
#4010
Copy link
Assignees
anmenaga
Labels
Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
Milestone
6.0.0-GA

Description

@hovsepm
Hovsep (hovsepm)
opened on May 3, 2017
Issue body actions

Steps to reproduce

In psd1 have the following lines.
NestedModules = @('.\netstandard1.6\Microsoft.Azure.Commands.Profile.dll')
FormatsToProcess = '.\netstandard1.6\Microsoft.Azure.Commands.Profile.format.ps1xml'

Expected behavior

Both files could be found and loaded throug import-module

Actual behavior

ps1xml has no issues while Microsoft.Azure.Commands.Profile.dll file fails with obscure error message:

PS /usr/local/src> Import-Module AzureRM.Profile.Netcore -Verbose -Debug
VERBOSE: Loading module from path
'/opt/microsoft/powershell/6.0.0-alpha.18/Modules/AzureRM.Profile.Netcore/1.0.0/AzureRM.Profile.Netcore.psd1'.
VERBOSE: Loading 'FormatsToProcess' from path
'/opt/microsoft/powershell/6.0.0-alpha.18/Modules/AzureRM.Profile.Netcore/1.0.0/netstandard1.6/Microsoft.Azure.Commands.Profile
.format.ps1xml'.
VERBOSE: Populating RepositorySourceLocation property for module AzureRM.Profile.Netcore.
Import-Module : The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
At line:1 char:1

  • Import-Module AzureRM.Profile.Netcore -Verbose -Debug
  •   + CategoryInfo          : NotSpecified: (:) [Import-Module], FileLoadException
      + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.ImportModuleCommand 
    
    

Environment data

Red Hat Enterprise Linux 7

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-alpha
PSEdition                      Core
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   3.0.0.0
GitCommitId                    v6.0.0-alpha.18
CLRVersion
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Current Workaround

Remove '.' at the beginning of each NestedModule and everything works fine on Windows, Linux and Mac OS.
It is inconsistent and the worst thing is the error message.

Activity

  1. Steve Lee (SteveL-MSFT)
    added
    Area-Cmdlets-Core
    on May 3, 2017
  2. Steve Lee (SteveL-MSFT)
    added this to the This milestone has been deleted milestone on May 3, 2017
  3. Steve Lee (SteveL-MSFT)
    added
    Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the product
    on May 3, 2017
  4. hovsepm commented on May 3, 2017

    @hovsepm
    Hovsep (hovsepm)
    on May 3, 2017
    Author
    More actions

    According to #3059 same thing happens with RootModule as well

  5. Steve Lee (SteveL-MSFT)
    self-assigned this
    on May 9, 2017
  6. SteveL-MSFT commented on May 9, 2017

    @SteveL-MSFT
    Steve Lee (SteveL-MSFT)
    on May 9, 2017
    Member
    More actions

    Hovsep (@hovsepm) not able to repro this. I tried importing the latest AzureRM.Profile.NetCore.Preview off of PSGallery and it imported fine. I tried creating a test module manifest with a subfolder to the dll and psm1 file and both succeeded. Need a repro to debug this.

  7. hovsepm commented on May 11, 2017

    @hovsepm
    Hovsep (hovsepm)
    on May 11, 2017
    Author
    More actions

    Steve Lee (@SteveL-MSFT) The module that I refer to is not published to gallery.
    The repro should be this - modify NestedModule like NestedModules = @('.\[subfolder]\[module name]') and try to import on Linux.

  8. Steve Lee (SteveL-MSFT)
    modified the milestones: This milestone has been deleted, This milestone has been deleted, This milestone has been deleted on May 15, 2017
  9. Steve Lee (SteveL-MSFT)
    assigned
    Andrew (anmenaga)
    and unassigned
    Steve Lee (SteveL-MSFT)
    on May 17, 2017
  10. Andrew (anmenaga)
    added a commit that references this issue on Jun 14, 2017

    Added tests for PowerShell#3693 fix

    7d03492
  11. Mike Richmond (mirichmo)
    closed this as completedin #4010on Jun 28, 2017
  12. Mike Richmond (mirichmo)
    added a commit that references this issue on Jun 28, 2017

    Fixing Import-Module on Linux for special cases of NestedModules/Root…

    ecefb50
  13. Ilya (iSazonov)
    added
    Resolution-FixedThe issue is fixed.The issue is fixed.
    on Jun 29, 2017
  14. Ryan Yates (kilasuit)
    added
    WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues
    and removed
    WG-Cmdlets-Core
    on Jul 17, 2026
  15. Thatgfsj (Thatgfsj)
    added a commit that references this issue on Aug 6, 2026

    Fixing Import-Module on Linux for special cases of NestedModules/Root…

    5b4b366
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @anmenaga
    Andrew (anmenaga)

Labels

Issue-BugIssue has been identified as a bug in the productIssue has been identified as a bug in the productResolution-FixedThe issue is fixed.The issue is fixed.WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issues

Type

No type

Projects

No projects

    Milestone

    • 6.0.0-GA

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402520 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.