ÿþ<html> <head> <title>Invoke-SqlIndexDefrag</title> </head> <body> <h1>Invoke-SqlIndexDefrag</h1> <div>Defragments an index.</div> <h2> Syntax </h2> <code>Invoke-SqlIndexDefrag [-index] &lt;Index&gt; [&lt;CommonParameters&gt;]</code> <h2> Detailed Description </h2> <div> The Invoke-SqlIndexDefrag function defragments the specified index. </div> <h2> Related Commands </h2> <div> * <a href='Invoke-SqlIndexDefrag.htm'>Invoke-SqlIndexDefrag</a><br/> </div> <h2> Parameters </h2> <table border='1'> <tr> <th>Name</th> <th>Description</th> <th>Required?</th> <th>Pipeline Input</th> <th>Default Value</th> </tr> <tr valign='top'> <td>index&nbsp;</td> <td>&nbsp;</td> <td>true&nbsp;</td> <td>true (ByValue)&nbsp;</td> <td>&nbsp;</td> </tr> </table> <h2> Input Type </h2> <div>None You can pipe SMO Index objects to Invoke-SqlIndexDefrag</div> <h2> Return Values </h2> <div>None This function does not generate any output.</div> <h2> Notes </h2> <div>Performs the equivalent of DBCC INDEXDEFRAG</div> <h2> Examples </h2> <h3> EXAMPLE 1</h3> <pre>Get-SqlDatabase "Z002\sql2k8" "pubs" | Get-SqlTable -name authors | Get-SqlIndex | Invoke-SqlIndexDefrag</pre> <div>This command defragments the indexes of the authors table</div> </body> </html>