Skip to content

Commit be25dbb

Browse files
Add troubleshooting guidance for Az and SqlServer modules
Added a section to the troubleshooting guide explaining how to import dbatools with Azure PowerShell (Az) or SqlServer modules to avoid assembly version conflicts. Instructions include recommended import order and use of the -ArgumentList $true parameter for conflict avoidance.
1 parent b3a0a7c commit be25dbb

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

readme.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,27 @@ Stop-Transcript
257257

258258
## Troubleshooting
259259

260+
### Using with Azure PowerShell (Az) or SqlServer Modules
261+
262+
If you use dbatools alongside the Az PowerShell module or Microsoft's SqlServer module in the same session, import them in this order to avoid assembly version conflicts:
263+
264+
```powershell
265+
# 1. Import Az or SqlServer modules first
266+
Import-Module Az.Accounts
267+
Import-Module SqlServer
268+
269+
# 2. Then import dbatools
270+
Import-Module dbatools
271+
```
272+
273+
If you still experience conflicts or need to use dbatools with other modules that have assembly conflicts, use the `-ArgumentList $true` parameter to enable conflict avoidance mode:
274+
275+
```powershell
276+
Import-Module dbatools -ArgumentList $true
277+
```
278+
279+
This skips loading conflicting Azure assemblies when incompatible versions are already loaded.
280+
260281
### Common Issues
261282

262283
**Issue: "Could not connect to SqlInstance"**

0 commit comments

Comments
 (0)