Get-DbaRegisteredServer - -ExcludeServer would be usefull
Summarize Functionality
When using Get-DbaRegisteredServer it would be nice to be able to exclude specific servers not just groups.
In example:
Get-DbaRegisteredServer CMS -group production -ExcludeServer "serverAlfa","ServerBeta"
The above would filter out ServerAlfa and ServerBeta despite they are in the group "production"
This would be usable if you want to avoid running a script on a certain server at a certain occassion. Such as that particular server is down for maintenance etc.
Is there a command that is similiar or close to what you are looking for?
Yes
Technical Details
I think I provided most of it above. But in general. I can probably make this function in my own script by filtering on the servernames through a loop. But for the sake of clarity, ease of use and also functionality, it would be a nice addition for the average user.
I can see how -Exclude parameters can be useful for commands that make changes, or so you don't have to process a bunch of objects only for the output to be thrown away later in the pipe, but in this case why not just use Where-Object? No changes are being made, and performance doesn't really take a hit.
Get-DbaRegisteredServer CMS -group production | Where-Object {$_.Name -notin "serverAlfa", "ServerBeta"}