-
-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
Importing dbatools and sqlserver modules fails regardless of the order they are imported in. This is due to dbatools having some DLLs newer than the versions in sqlserver and some that are older.
To workaround the issue I have had to replace the DLLs in the dbatools folder with ones from sqlserver.
Microsoft.Identity.Client.dll
Microsoft.Data.SqlClient.dll
There may be others with the same issue.
Steps to Reproduce
# provide your command(s) executed pertaining to dbatools
# please include variable values (redacted or fake if needed) for reference
if (get-module -name dbatools -listavailable) {uninstall-module dbatools -AllVersions -Force}
if (get-module -name dbatools.library -listavailable) {uninstall-module dbatools.library -AllVersions -Force}
install-module -Name dbatools -Force -confirm:$false -AllowClobber -Scope CurrentUser -Repository PSGallery
if (get-module -name sqlserver -listavailable) {uninstall-module sqlserver -AllVersions -Force}install-module -Name sqlserver -Force -confirm:$false -AllowClobber -Scope CurrentUser -Repository PSGallery
import-module dbatools
import-module sqlserverPlease confirm that you are running the most recent version of dbatools
2.1.10
Other details or mentions
importing sqlserver first appears to work in the ps prompt but generates "Assembly with same name is already loaded" if done as part of a module psd1 file.
What PowerShell host was used when producing this error
PowerShell Core (pwsh.exe)
PowerShell Host Version
Name Value
PSVersion 7.4.1
PSEdition Core
GitCommitId 7.4.1
OS Microsoft Windows 10.0.22631
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
SQL Server Edition and Build number
Microsoft SQL Server 2019 (RTM-CU25) (KB5033688) - 15.0.4355.3 (X64) Jan 30 2024 17:02:22 Copyright (C) 2019 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2019 Datacenter 10.0 (Build 17763: ) (Hypervisor)
.NET Framework Version
.NET 8.0.1