Execution Flow
-VerifyOnly does not restore any data — SQL Server reads and validates the backup stream and checksums without writing to any database. If no -BackupPath is provided, the path is read from the sqmSQLTool module configuration (Get-sqmConfiguration -Key BackupPath). Use -FileListOnly to get a quick inventory of all backup files without running the checksum verification.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| -SqlInstance | String | Optional | SQL Server instance used to run the verify. Default: $env:COMPUTERNAME. |
| -SqlCredential | PSCredential | Optional | SQL authentication credential. |
| -BackupPath | String[] | Optional | One or more UNC/local paths containing backup files. Falls back to module config if omitted. |
| -FileListOnly | Switch | Optional | Return backup file inventory without running -VerifyOnly. |
| -EnableException | Switch | Optional | Throw terminating errors instead of logging warnings. |
Return Value
Returns a PSCustomObject[] — one entry per backup file — with: SqlInstance, BackupFile, DatabaseName, BackupType, BackupStart, BackupFinish, Status, Message.
Examples
Example 1 — Verify all backups in configured path
Test-sqmBackupIntegrity
Example 2 — Verify specific backup path
Test-sqmBackupIntegrity -SqlInstance "SQL01" -BackupPath "\\NAS01\Backups\SQL01"
Example 3 — List backup files only (no verify)
Test-sqmBackupIntegrity -BackupPath "\\NAS01\Backups" -FileListOnly | Format-Table -AutoSize
Example 4 — Show only failed verifications
Test-sqmBackupIntegrity | Where-Object Status -eq 'Failed'