-
Notifications
You must be signed in to change notification settings - Fork 204
Description
-
Rename 'function Discover-MSSQLServers.ps1' to 'function Discover-MSSQLServers'
-
Remove the GroupResults and SortResults functionality. You should only output object and let the user figure out what to do with the raw output.
-
Is there a distinct performance hit when -ExtendedInfo is provided? If not, remove the -ExtendedInfo switch and just query those properties by default. Ideally, a function shouldn't output more than one type of object.
-
Only output objects! The following line is the equivalent of Write-Host and is unnecessary:
Write-Output "Discovered $AllMSSQLServerFQDNsCount servers running MS SQL `r " -
When creating custom object, creating a hastable of properties and adding them to a PSObject seems to be the unofficial best practice.
e.g.
$ObjectProperties = @{
Prop1 = 1
Prop2 = 2
}New-Object -TypeName PSObject -Property $ObjectProperties
Otherwise, everything looks good! Now, I don't have a domain environment in which I can test this but perhaps @obsuresec does. Nice work!
-Matt