Skip to content

Commit 43a9191

Browse files
revert
1 parent 3779520 commit 43a9191

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

dbatools.library.psm1

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -63,24 +63,6 @@ if ($PSVersionTable.PSEdition -ne "Core") {
6363
{
6464
if (assemblyName == dll)
6565
{
66-
// Windows PowerShell 5.1/.NET Framework: Only special-case System.Management.Automation
67-
if (assemblyName == "System.Management.Automation")
68-
{
69-
var loaded = AppDomain.CurrentDomain.GetAssemblies()
70-
.FirstOrDefault(a => a.GetName().Name == "System.Management.Automation");
71-
if (loaded != null)
72-
{
73-
var requestedVersion = name.Version;
74-
var loadedVersion = loaded.GetName().Version;
75-
if (requestedVersion != null && loadedVersion != null && requestedVersion != loadedVersion)
76-
{
77-
System.Diagnostics.Trace.TraceWarning(
78-
string.Format("[dbatools] Requested System.Management.Automation version {0}, but loaded version is {1}. Using loaded version.", requestedVersion, loadedVersion));
79-
}
80-
return loaded;
81-
}
82-
// If not found, fall through to normal logic (should not happen in PowerShell host)
83-
}
8466
string filelocation = "$dir" + dll + ".dll";
8567
//Console.WriteLine(filelocation);
8668
return Assembly.LoadFrom(filelocation);

0 commit comments

Comments
 (0)