How to use -Target <list> in New-DatabaseReleaseArtifact?
PeterDaniels
Posts: 89 Bronze 3
The docs for New-DatabaseReleaseArtifact discuss using a list of one or more items as an argument to the -Target parameter. When I tried to do that, I got: "to create a release for a SQL change automation project, the Target must be a single database". Can anyone tell me how the list of targets may be utilized?
Tagged:
Best Answer
-
Eddie D Posts: 1,802 Rose Gold 5Hi Peter, thank you for your reply.
I think there is a mi-understanding, regarding this line in the help documentation:
If you use a list, the cmdlet will check that everything in the list has the same database schema. If there are no differences in schema, the cmdlet will create the Database Release. If there are any differences in schema, the cmdlet will fail and inform you.
You can only specify one target schema. However, you can use a list containing one or more methods (listed below) to specify the one schema:
a Database Connection object created by the New-DatabaseConnection cmdlet
- a database connection string
- a path for a NuGet package or .zip file. This must contain a scripts folder located at db\state
- a Database Build Artifact object produced by the New-DatabaseBuildArtifact cmdlet
- a path for a scripts folder, created by SQL Compare or from your SQL Source Control database repository
- a list containing one or more of the above
There is not a method available to specify multiple schemas.
Many Thanks
Eddie
Answers