I'm starting to use Powershell for all my administrative tasks, overnight backups & maintenance, and I'm wondering if anyone has scripted any DBCC functions in Powershell. From what I can see there is no method that corresponds to CheckDB, so I'm doing the following nightly
$db.checkallocations(0)
$db.checktables(0)
$db.checkcatalog()
and the following weekly
$db.updateindexstatistics()
I can't see anything around index refreshes.
Any suggestions or comments would be appreciated.