@@ -360,7 +360,16 @@ function Get-DbaBackupInformation {
360360 if (-not $dbLsn ) {
361361 $dbLsn = 0
362362 }
363- $description = $group.Group [0 ].BackupTypeDescription
363+ $description = switch ($group.Group [0 ].BackupTypeDescription) {
364+ " Database" { " Full" }
365+ " Database Differential" { " Differential" }
366+ " Transaction Log" { " Log" }
367+ " File or Filegroup" { " File" }
368+ " File Differential" { " Differential File" }
369+ " Partial Database" { " Partial Full" }
370+ " Partial Differential" { " Partial Differential" }
371+ default { $group.Group [0 ].BackupTypeDescription }
372+ }
364373 if (-not $description ) {
365374 try {
366375 $header = Read-DbaBackupHeader - SqlInstance $server - Path $Path - EnableException | Select-Object - First 1
@@ -375,15 +384,24 @@ function Get-DbaBackupInformation {
375384 }
376385 $historyObject = New-Object Dataplat.Dbatools.Database.BackupHistory
377386 $historyObject.ComputerName = $group.Group [0 ].MachineName
378- $historyObject.InstanceName = $group.Group [0 ].ServiceName
387+ $instanceName = $group.Group [0 ].ServiceName
388+ if (-not $instanceName -and $group.Group [0 ].ServerName -like " *\*" ) {
389+ $instanceName = $group.Group [0 ].ServerName.Split(" \" )[1 ]
390+ } elseif (-not $instanceName ) {
391+ $instanceName = " MSSQLSERVER"
392+ }
393+ $historyObject.InstanceName = $instanceName
379394 $historyObject.SqlInstance = $group.Group [0 ].ServerName
380395 $historyObject.Database = $group.Group [0 ].DatabaseName
381396 $historyObject.UserName = $group.Group [0 ].UserName
382397 $historyObject.Start = [DateTime ]$group.Group [0 ].BackupStartDate
383398 $historyObject.End = [DateTime ]$group.Group [0 ].BackupFinishDate
384399 $historyObject.Duration = ([DateTime ]$group.Group [0 ].BackupFinishDate - [DateTime ]$group.Group [0 ].BackupStartDate)
385400 $historyObject.Path = [string []]$group.Group.BackupPath
386- $historyObject.FileList = ($group.Group.FileList | Select-Object Type, LogicalName, PhysicalName, @ {
401+ $historyObject.FileList = ($group.Group.FileList | Select-Object @ {
402+ Name = " FileType"
403+ Expression = { $PSItem.Type }
404+ }, LogicalName, PhysicalName, @ {
387405 Name = " Size"
388406 Expression = { [dbasize ]$PSItem.Size }
389407 } - Unique)
@@ -401,6 +419,9 @@ function Get-DbaBackupInformation {
401419 $historyObject.SoftwareVersionMajor = $group.Group [0 ].SoftwareVersionMajor
402420 $historyObject.RecoveryModel = $group.Group.RecoveryModel
403421 $historyObject.IsCopyOnly = $group.Group [0 ].IsCopyOnly
422+ if ($null -ne $group.Group [0 ].LastRecoveryForkGUID) {
423+ $historyObject.LastRecoveryForkGuid = $group.Group [0 ].LastRecoveryForkGUID
424+ }
404425 $groupResults += $historyObject
405426 }
406427 }
@@ -420,7 +441,7 @@ function Get-DbaBackupInformation {
420441 $group.UserName = Get-HashString - InString $group.UserName
421442 $group.Path = Get-HashString - InString $group.Path
422443 $group.FullName = Get-HashString - InString $group.FullName
423- $group.FileList = ($group.FileList | Select-Object Type ,
444+ $group.FileList = ($group.FileList | Select-Object FileType ,
424445 @ {Name = " LogicalName" ; Expression = { Get-HashString - InString $_ ." LogicalName" } },
425446 @ {Name = " PhysicalName" ; Expression = { Get-HashString - InString $_ ." PhysicalName" } })
426447 }
0 commit comments