Red Gate forums :: View topic - Working with Options and PowerShell
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Comparison SDK 10
SQL Comparison SDK 10 forum

Working with Options and PowerShell

Search in SQL Comparison SDK 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
dbaduck



Joined: 10 Oct 2012
Posts: 1

PostPosted: Wed Oct 10, 2012 6:05 am    Post subject: Working with Options and PowerShell Reply with quote

When I use the Options.Default things work OK, but I want to add an option IgnoreConstraintNames, but in PowerShell you can specify one or the other, but I need to know how you would do this when executing the CompareWith and want to combine multiple options.

You cannot do [RedGate.SqlCompare.Engine.Options]::Default + [RedGate.SqlCompare.Engine.Options]::IgnoreConstraintNames

because it gives you an error that there is no op_Add for this type of object.

Thanks.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6643

PostPosted: Thu Oct 11, 2012 11:19 am    Post subject: Reply with quote

I haven't done much powershell myself, but what you need to do is a "bitwise or" operation to append an option to the default options. Powershell defines an operator for this called -bor, so hopefully this works:
Quote:
([RedGate.SqlCompare.Engine.Options]::Default -bor [RedGate.SqlCompare.Engine.Options]::IgnoreConstraintNames)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group