commands

^

New-DbaScriptingOption

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows, Linux, macOS

 

Synopsis

Creates a new Microsoft.SqlServer.Management.Smo.ScriptingOptions object

Description

Creates a new Microsoft.SqlServer.Management.Smo.ScriptingOptions object. Basically saves you the time from remembering the SMO assembly name ;)

See https://msdn.microsoft.com/en-us/library/microsoft.sqlserver.management.smo.scriptingoptions.aspx for more information

Syntax

New-DbaScriptingOption
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> $options = New-DbaScriptingOption
PS C:\> $options.ScriptDrops = $false
PS C:\> $options.WithDependencies = $true
PS C:\> Get-DbaAgentJob -SqlInstance sql2016 | Export-DbaScript -ScriptingOptionObject $options

Exports Agent Jobs with the Scripting Options ScriptDrops set to $false and WithDependencies set to true

 

Want to see the source code for this command? Check out New-DbaScriptingOption on GitHub.
Want to see the Bill Of Health for this command? Check out New-DbaScriptingOption.