-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Description
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.1Current 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.