Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save SQLDBAWithABeard/4af918a33686d98d9cfcaa65d3f694f3 to your computer and use it in GitHub Desktop.
Save SQLDBAWithABeard/4af918a33686d98d9cfcaa65d3f694f3 to your computer and use it in GitHub Desktop.
$instance = ''
$Databases = ''
$CompressedSize = @{Name='Compressed';Exp={[math]::round($_.CompressedBackupSize/1Tb,3)}}
$Size = @{Name = 'Size';Exp={[math]::Round($_.TotalSize/1Tb,3)}}
## Get the info
Get-DbaBackupHistory -SqlInstance $instance -Database $databases -Last -Raw | Select Database, Path, $CompressedSize , $Size
#get the total size of files
(Get-DbaBackupHistory -SqlInstance $instance -Database $databases -Last -Raw | Select Database, Path, $CompressedSize | Measure-Object Compressed -Sum).Sum
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment