| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Import-Module $moduleFilePath | ||
| (Get-Module $moduleName).ExportedCommands.Keys.Contains('TestModuleFunction') | Should Be $true | ||
| } | ||
| } No newline at end of file |
There was a problem hiding this comment.
The little red icon means you should have a trailing linefeed at the end of the file
Sorry, something went wrong.
There was a problem hiding this comment.
I always forget about that newline... Updated.
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
…Module path format (PowerShell#4010) * IPMO fix for some cases of NestedModules/RootModule path syntax * Added tests for PowerShell#3693 fix * Updated tests
| Back | FazBrowse Home | New Git URL |
NestedModules/RootModule are fields in a module manifest (.psd1) that reference other modules using string paths. Assuming that a module is written to be cross-platform, the same psd1 module manifest should be successfully imported on both Windows and Linux platforms.
The bug is that in some cases Import-Module on Linux fails for a totally valid module. It depends on format of NestedModules/RootModule paths.
The root of the problem is using simple Path.Combine for constructing a path to the submodule, that is then tested using NativeItemExists methods, resulting in calls like
Unix.NativeMethods.IsFile("/home/testuser/TestRootModule/.\SubModule\SubModule.psm1")
which fails and Import-Module returns an error.
The fix is to resolve submodule paths using existing FileSystem provider utilities.
Test results on Ubuntu 14 after the fix:

Test results on Ubuntu 14 before the fix:

Fix #3693