Open wsmelton opened 1 year ago
I can see here that all the logins get referenced for the rename process but there is lighter methods for checking this; even if we just create internal test function like Test-LoginExist
or something.
I don't think there is a need to actually check for a login because the rename operation should fail with a clean error indicating it already exist.
Removed pulling all logins and the test alone dropped more than half the time to run
Also adding more granular WhatIf so folks can see what actually gets changed.
Adjust the Alter method to only get hit if something beside the password parameters were provided.
Verified issue does not already exist?
No, I did not search
What error did you receive?
No error, look at the verbose output of this command. Even if you provide a list of Logins to
-Login
it is still pulling every login on the instance.Because of this section of code, not sure why it was done this way, but we should not be pulling every possible login, and then filtering it.
https://github.com/dataplat/dbatools/blob/0433f3260cc448b8ca932b8da4a4b777a656768a/public/Set-DbaLogin.ps1#L240-L250
Steps to Reproduce
Please confirm that you are running the most recent version of dbatools
Development branch
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