Skip to content
Permalink
Browse files

Get-DbaRegisteredServer - fix group name bug introduced with local re…

…g server support (#5645)

* format dat

* handle some bad reg servers

ugly fix for #5632

* formatting
  • Loading branch information...
potatoqualitee committed May 30, 2019
1 parent f57c46d commit d88abe951165d977e27f87a6f0aa7cbb6d25acdc
Showing with 43 additions and 1 deletion.
  1. +5 −0 functions/Get-DbaRegServer.ps1
  2. +38 −1 xml/dbatools.Format.ps1xml
@@ -222,6 +222,11 @@ function Get-DbaRegServer {
$groupname = ($groupname -join "\")
}
}
# ugly way around it but it works
$badform = "$($server.Name.Split("\")[0])\$($server.Name.Split("\")[0])"
if ($groupname -eq $badform) {
$groupname = $null
}


if ($server.ConnectionStringWithEncryptedPassword) {
@@ -522,7 +522,44 @@
</TableRowEntries>
</TableControl>
</View>

<!-- Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer -->
<View>
<Name>Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer</Name>
<ViewSelectedBy>
<TypeName>Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer</TypeName>
</ViewSelectedBy>
<TableControl>
<AutoSize/>
<TableHeaders>
<TableColumnHeader/>
<TableColumnHeader/>
<TableColumnHeader/>
<TableColumnHeader/>
<TableColumnHeader/>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>ServerName</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Group</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Description</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Source</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
<!-- Sqlcollaborative.Dbatools.Validation.LinkedServerResult -->
<View>
<Name>Sqlcollaborative.Dbatools.Validation.LinkedServerResult</Name>

0 comments on commit d88abe9

Please sign in to comment.
You can’t perform that action at this time.