New-DbaDbUser doesn't respect -Database param for system dbs #8888
Closed
Description
Verified issue does not already exist?
Yes
What error did you receive?
When creating a user in a system database, the function claims that specifying a Database will override the default mode of excluding system databases, but it does not.
The param description:
dbatools/public/New-DbaDbUser.ps1
Lines 25 to 26 in ffb7b37
The logic:
dbatools/public/New-DbaDbUser.ps1
Lines 155 to 157 in ffb7b37
Steps to Reproduce
# No change
New-DbaDbUser -SqlInstance localhost -Database master -User lowlydba2 -Login lowlydba -DefaultSChema "Information_SCHEMA" -Verbose
# Works
New-DbaDbUser -SqlInstance localhost -Database master -User lowlydba2 -Login lowlydba -DefaultSChema "Information_SCHEMA" -Verbose -IncludeSystem
Please confirm that you are running the most recent version of dbatools
v2.0.0 (congrats!)
Other details or mentions
No response
What PowerShell host was used when producing this error
PowerShell Core (pwsh.exe)
PowerShell Host Version
N/A
SQL Server Edition and Build number
N/A
.NET Framework Version
N/A