ÿþ<html> <head> <title>Get-SqlScripter</title> </head> <body> <h1>Get-SqlScripter</h1> <div>Scripts an SMO object.</div> <h2> Syntax </h2> <code>Get-SqlScripter [-smo] &lt;Object&gt; [[-scriptingOptions] &lt;ScriptingOptions&gt;] [&lt;CommonParameters&gt;]</code> <h2> Detailed Description </h2> <div> The Get-SqlScripter function calls the script method for an SMO object(s). </div> <h2> Related Commands </h2> <div> * <a href='Get-SqlScripter.htm'>Get-SqlScripter</a><br/> * <a href='New-SqlScriptingOptions.htm'>New-SqlScriptingOptions</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>smo&nbsp;</td> <td>&nbsp;</td> <td>true&nbsp;</td> <td>true (ByValue)&nbsp;</td> <td>&nbsp;</td> </tr> <tr valign='top'> <td>scriptingOptions&nbsp;</td> <td>&nbsp;</td> <td>false&nbsp;</td> <td>false&nbsp;</td> <td>&nbsp;</td> </tr> </table> <h2> Input Type </h2> <div>Microsoft.SqlServer.Management.Smo.* You can pipe SMO objects to Get-SqlScripter</div> <h2> Return Values </h2> <div>System.String Get-SqlScripter returns an array System.String.</div> <h2> Examples </h2> <h3> EXAMPLE 1</h3> <pre>Get-SqlDatabase "Z002\sql2k8" "pubs" | Get-SqlTable | Get-SqlScripter</pre> <div>This command scripts out all user tables in the pubs database.</div> <h3> EXAMPLE 2</h3> <pre>Get-SqlDatabase "Z002\sql2k8" "pubs" | Get-SqlTable -name "authors" | Get-SqlScripter</pre> <div>This command scripts out the authors table.</div> <h3> EXAMPLE 3</h3> <pre>$scriptingOptions = New-SqlScriptingOptions $scriptingOptions.Permissions = $true $scriptingOptions.IncludeIfNotExists = $true Get-SqlDatabase "Z002\sql2k8" "pubs" | Get-SqlTable | Get-SqlScripter -scriptingOptions $scriptingOptions</pre> <div>This command scripts out all users tables in the pubs database and passes a scriptingOptions.</div> </body> </html>