mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Avoid trying to load DLLs as Snap-Ins with Import-Module
Thanks @lzybkr.
This commit is contained in:
@@ -6827,7 +6827,6 @@ namespace Microsoft.PowerShell.Commands
|
||||
InitialSessionState iss = InitialSessionState.Create();
|
||||
List<string> detectedCmdlets = null;
|
||||
List<Tuple<string, string>> detectedAliases = null;
|
||||
PSSnapInException warning;
|
||||
Assembly assembly = null;
|
||||
Exception error = null;
|
||||
bool importSuccessful = false;
|
||||
@@ -6885,6 +6884,9 @@ namespace Microsoft.PowerShell.Commands
|
||||
{
|
||||
PSSnapInInfo snapin = null;
|
||||
|
||||
#if !CORECLR
|
||||
// Avoid trying to load SnapIns with Import-Module
|
||||
PSSnapInException warning;
|
||||
try
|
||||
{
|
||||
if (importingModule)
|
||||
@@ -6897,6 +6899,7 @@ namespace Microsoft.PowerShell.Commands
|
||||
//BUGBUG - brucepay - probably want to have a verbose message here...
|
||||
;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (snapin != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user