Add-AzureSqlJobChildTarget
Associates a target to a custom collection target.
Syntax
Add-AzureSqlJobChildTarget
[-Exclude]
-CustomCollectionName <String>
-TargetId <Guid[]>
[[-AzureSqlJobConnection] <AzureSqlJobConnection>]
[<CommonParameters>]
Add-AzureSqlJobChildTarget
[-Exclude]
-CustomCollectionName <String>
-ServerName <String[]>
-DatabaseName <String[]>
[-LiteralServerName]
[[-AzureSqlJobConnection] <AzureSqlJobConnection>]
[<CommonParameters>]
Description
The Add-AzureSqlJobChildTarget cmdlet associates a target to a custom collection target. Jobs that are run targeting custom collections are expanded to target all targets associated within the custom collection at the time this cmdlet is run.
Examples
Example 1: Add a database target to a custom collection as a child target
PS C:\>Add-AzureSqlDatabaseJobChildTarget -CustomCollectionName "MyCustomCollection" -ServerName "MyServer.database.contoso.net" -DatabaseName "MyDatabase"
This command adds a database target to a custom collection as a child target. Database targets can be child targets of multiple custom collections.
Example 2: Add a custom collection to another custom collection
PS C:\>Add-AzureSqlDatabaseJobChildTarget -CustomCollectionName "MyCustomCollection" -TargetId (Get-AzureSqlDatabaseJobTarget -CustomCollectionName "MyOtherCustomCollection").TargetId
This command adds a custom collection to another custom collection.
Parameters
-AzureSqlJobConnection
Specifies the connection state object for the job. You can get the connection state object through the New-AzureSqlJobConnection cmdlet. If you do not specify this parameter, the connection state is used from a prior call to the Use-AzureSqlJobConnection cmdlet.
Type: | AzureSqlJobConnection |
Position: | 1 |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-CustomCollectionName
Specifies the name of the custom collection target to contain the association of the provided database.
Type: | String |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-DatabaseName
Specifies the database name of the database target to add as a child target to the specified custom collection.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Exclude
{{Fill Exclude Description}}
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-LiteralServerName
{{Fill LiteralServerName Description}}
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-ServerName
Specifies the server name of the database target to add as a child target to the specified custom collection.
Type: | String[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-TargetId
Specifies the ID of the target to add into the provided custom collection.
Type: | Guid[] |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
Related Links
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for