Skip to content

Instantly share code, notes, and snippets.

@shaneis
Created February 20, 2018 21:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaneis/c6d16427aa0b08463e65540c4b56bca6 to your computer and use it in GitHub Desktop.
Save shaneis/c6d16427aa0b08463e65540c4b56bca6 to your computer and use it in GitHub Desktop.
Quick test for blog post
Describe -Name "Should have >= 30 backup files on storage" -Tag 'FilesOnStorage' {
Context -Name "Full backups for LocalTesting" {
It "should have greater than or equal to 30 backup files" {
Get-DbaBackupHistory -SqlInstance localhost\SQLDEV2K14 -Database LocalTesting -Type Full |
Measure-Object |
Select-Object -ExpandProperty Count |
Should -BeGreaterOrEqual 30 -Because "Business reasons say so"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment