Compare-CDObject
From PowerGUI Wiki
Compares two Change Director objects
Contents |
Syntax
Compare-CDObject [-ObjectToCompare1] <PSObject> [-ObjectToCompare2] <PSObject> [-IgnoreConstraintNames] [-IgnoreColumnOrder] [-IgnoreIdentity] [-IgnoreFillFactor] [-Exclude [<String[]>]] [-Include [<String[]>]] [-ExcludeTypes [<String[]>]] [-IncludeTypes [<String[]>]] [<CommonParameters>]
Detailed Description
Compares two Change Director objects (CDDatabase or CDSnapshot) with some options.
Related Commands
Parameters
| Name | Description | Required? | Pipeline Input | Default Value |
|---|---|---|---|---|
| ObjectToCompare1 | First object to compare. CDDatabase or CDSnapshot object | true | false | |
| ObjectToCompare2 | Second object to compare. CDDatabase or CDSnapshot object | true | false | |
| IgnoreConstraintNames | Ignore constraint names | false | false | |
| IgnoreColumnOrder | Ignore column order | false | false | |
| IgnoreIdentity | Ignore identity | false | false | |
| IgnoreFillFactor | Ignore fill factor | false | false | |
| Exclude | Exclude objects patterns. This parameter has less priority then Include parameter. Wildcards are allowed. | false | false | |
| Include | Include objects patterns. This parameter has more priority then Exclude parameter. Wildcards are allowed. | false | false | |
| ExcludeTypes | Types for exclude from comparison. Can be one of these values Table, View, User, Role, Schema, Procedure, CLRProcedure, Function, CLRFunction, Type, CLRType, Rule, Default, DDLTrigger, DDLCLRTrigger, XMLSchemaCollection, Assembly, PartitionFunction, PartitionScheme, Synonym, Aggregate | false | false | |
| IncludeTypes | Types for include in comparison. Other types will be ignored. Can be one of these values Table, View, User, Role, Schema, Procedure, CLRProcedure, Function, CLRFunction, Type, CLRType, Rule, Default, DDLTrigger, DDLCLRTrigger, XMLSchemaCollection, Assembly, PartitionFunction, PartitionScheme, Synonym, Aggregate | false | false |
Return Values
CDCompareResult
Examples
Example 1
$a=Get-CDDatabase myServ base1
$b=Get-CDDatabase srvMain base2
Compare-CDObject $a $b
This returns result of comparison between two databases.
Example 2
$a=get-cddatabase myServ base1
$b=get-cddatabase srvMain base2
Compare-CDObject $a $b -Exclude dbo.*temp*
This returns result of comparison between two databases. Objects that has 'dbo' schema and contains temp in name will be excluded from comparison.
