< Back

New-DbaScriptingOption

Mon Jan 13, 2020 12:59 pm

NAME New-DbaScriptingOption



SYNOPSIS

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





SYNTAX

New-DbaScriptingOption [<CommonParameters>]





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/librar ... tions.aspx for more

information





PARAMETERS

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS



NOTES





Tags: Migration, Backup, DR

Author: Chrissy LeMaire (@cl), netnerds.net



Website: https://dbatools.io

Copyright: (c) 2018 by dbatools, licensed under MIT

License: MIT https://opensource.org/licenses/MIT



-------------------------- 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



RELATED LINKS

https://dbatools.io/New-DbaScriptingOption