Issues with Import-Module on Custom PowerShell Core module with classes

Hello Everyone,

I have this sample custom powershell core module with a test class called TestModule and I’m unable to import the module: https://github.com/MSAdministrator/TestModule

When Running PowerShell Core 6.1.1 on macOS I receive the following error when attempting to Import the module:

The specified module '/TestModule/Class/TestClass.psm1' was not loaded because no valid module file was found in any module directory. + CategoryInfo : InvalidOperation: (.../TestClass.psm1:String) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand Import-Module : The specified module './TestModule/TestModule.psm1' was not loaded because no valid module file was found in any module directory. At line:1 char:1 + Import-Module ./TestModule/TestModule.psm1 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (./TestModule/TestModule.psm1:String) [Import-Module], FileNotFoundException + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand 

Any ideas would be really helpful! Thanks!

submitted by /u/_Unas_
[link] [comments]

Leave a Reply