10000 Trailing slash on directory path breaks Import-Module command · Issue #5533 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Trailing slash on directory path breaks Import-Module command #5533

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

Closed
pcgeek86 opened this issue Nov 22, 2017 · 0 comments · Fixed by #6602
Closed

Trailing slash on directory path breaks Import-Module command #5533

pcgeek86 opened this issue Nov 22, 2017 · 0 comments · Fixed by #6602
Assignees
Labels
Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif WG-Cmdlets-Core cmdlets in the Microsoft.PowerShell.Core module

Comments

@pcgeek86
Copy link

Steps to reproduce

PS /Users/tsulli> ipmo ./git/CUSTOMMODULE/
ipmo : The specified module './git/CUSTOMMODULE/' was not loaded because no valid module file was found in any module directory.
At line:1 char:1
+ ipmo ./git/CUSTOMMODULE/
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : ResourceUnavailable: (./git/CUSTOMMODULE/:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS /Users/tsulli> ipmo ./git/CUSTOMMODULE
PS /Users/tsulli> gmo

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     0.2        CUSTOMMODULE
Binary     3.3.189.1  AWSPowerShell.NetCore               {Add-AASScalableTarget, Add-ACMCertificateTag, Add-ADSConfigurationItemsToApplication, Add-ASAAt...
Manifest   3.1.0.0    Microsoft.PowerShell.Management     {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty...}
Manifest   3.1.0.0    Microsoft.PowerShell.Utility        {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script     1.1.7.0    PackageManagement                   {Find-Package, Find-PackageProvider, Get-Package, Get-PackageProvider...}
Script     1.5.0.0    PowerShellGet                       {Find-Command, Find-DscResource, Find-Module, Find-RoleCapability...}
Script     1.2        PSReadLine                          {Get-PSReadlineKeyHandler, Get-PSReadlineOption, Remove-PSReadlineKeyHandler, Set-PSReadlineKeyH...

Expected behavior

Import-Module command should succeed whether or not the trailing slash is present.

Actual behavior

Adding a trailing slash to the directory path of a module causes Import-Module command to throw an exception.

Environment data

PS /Users/tsulli> $PSVersionTable

Name                           Value
----                           -----
PSVersion                      6.0.0-rc
PSEdition                      Core
GitCommitId                    v6.0.0-rc
OS                             Darwin 16.7.0 Darwin Kernel Version 16.7.0: Wed Oct  4 00:17:00 PDT 2017; root:xnu-3789.71.6~1/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

Cheers,
Trevor Sullivan

@iSazonov iSazonov added WG-Cmdlets-Core cmdlets in the Microsoft.PowerShell.Core module Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be recl 8313 assif labels Nov 23, 2017
@SteveL-MSFT SteveL-MSFT added this to the 6.1.0-Consider milestone Dec 12, 2017
@SteveL-MSFT SteveL-MSFT self-assigned this Apr 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Discussion the issue may not have a clear classification yet. The issue may generate an RFC or may be reclassif WG-Cmdlets-Core cmdlets in the Microsoft.PowerShell.Core module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
0