Exception from HRESULT: 0x80131047
Steps to reproduce
Import-Module IT GlueAPI
Expected behavior
The module is imported
Actual behavior
Error: The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
Running from Windows causes not problem at all. Running it from our RMM generated the above error. Someone had the same problem in PowerShell/PowerShell#3059 and this was the solution:
My RootModule in my .psd1 was prefixed with
.\. Perhaps this may help.
Changing it from '.\ITGlueAPI.psm1' to "$PSScriptRoot\ITGlueAPI.psm1" solves the issue while still referencing the the correct path.
I will create a pull request.
I think RootModule should omit the path prefix entirely. See Microsoft's documentation and example for RootModule. Using the root module name only has worked for me in my own modules.
RootModule = "ITGlueAPI.psm1"
@davidhaymond You are most likely right but I cannot test this at the moment so I will leave it as is and let someone with more knowledge on the subject decide what to do.