New-ReplScriptOptions
Creates an instance of a RMO ScriptOptions object used for scripting RMO objects.
Syntax
New-ReplScriptOptions [<CommonParameters>]
Detailed Description
The New-ReplScriptOptions function creates an instance of a custom RMO ScriptOptions object used for scripting RMO objects by the Get-ReplScript function.
Related Commands
Parameters
Name |
Description |
Required? |
Pipeline Input |
Default Value |
|
|
|
|
|
Input Type
None
You cannot pipe objects to New-ReplScriptOptions
Return Values
System.int64
New-ReplScriptOptions returns an System.int64 object.
Notes
Unlike SMO which has default script options, RMO at at a minimum requires CREATION be specified. The CREATION property is set to default to true.
The RMO implementation of scripting uses an enum with flagsattribute set to combine multiple options. In order to make RMO scripting options
discoverable and easier to use a custom object with all available RMO script options as properties is created. For any property set to true the
function will perform a bitwise operation that can then be use by an RMO script method.
There are 35 settable scripting options at the time of this writing, see link below for detailed explanation of each option.
Examples
EXAMPLE 1
$scriptOpts = New-ReplScriptOptions; $scriptOpts.Deletion = $true; Get-ReplServer "Z002\sql2K8" | Get-replscript -scriptOpts $scriptOpts
This command creates an RMO Scriptoptions object, sets the Deletion property to true and finally calls Get-replscript passing the script options.