Skip to content

Commit 45a880a

Browse files
authored
Merge pull request #9561 from arestarh/Wait-AzRecoveryServicesBackupJob_Fix
Update Get-AzRecoveryServicesBackupContainer.md, Get-AzRecoveryServicesVault.md and Wait-AzRecoveryServicesBackupJob.md
2 parents 98deff6 + 2dde41a commit 45a880a

File tree

4 files changed

+62
-40
lines changed

4 files changed

+62
-40
lines changed

src/RecoveryServices/RecoveryServices/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
-->
2020
## Upcoming Release
2121
* Update 'Get-AzRecoveryServicesBackupJob.md'
22+
* Update 'Get-AzRecoveryServicesBackupContainer.md'
23+
* Update 'Get-AzRecoveryServicesVault.md'
24+
* Update 'Wait-AzRecoveryServicesBackupJob.md'
2225
* Updated service call for Unregistering container for Azure File Share
2326

2427
## Version 1.4.2

src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesBackupContainer.md

Lines changed: 28 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ schema: 2.0.0
99
# Get-AzRecoveryServicesBackupContainer
1010

1111
## SYNOPSIS
12+
1213
Gets Backup containers.
1314

1415
## SYNTAX
@@ -20,32 +21,39 @@ Get-AzRecoveryServicesBackupContainer [-ContainerType] <ContainerType> [[-Backup
2021
```
2122

2223
## DESCRIPTION
24+
2325
The **Get-AzRecoveryServicesBackupContainer** cmdlet gets a backup container.
2426
A Backup container encapsulates data sources that are modelled as backup items.
25-
Set the vault context by using the Set-AzRecoveryServicesVaultContext cmdlet before you use the current cmdlet.
27+
Set the vault context by using the -VaultId parameter.
2628

2729
## EXAMPLES
2830

2931
### Example 1: Get a specific container
30-
```
31-
PS C:\>Get-AzRecoveryServicesContainer -ContainerType "AzureVM" -Status "Registered" -Name "V2VM";
32+
33+
```powershell
34+
PS C:\> $vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
35+
PS C:\> Get-AzRecoveryServicesBackupContainer -ContainerType "AzureVM" -Status "Registered" -Name "V2VM" -VaultId $vault.ID
3236
```
3337

3438
This command gets the container named V2VM of type AzureVM.
3539

3640
### Example 2: Get all containers of a specific type
37-
```
38-
PS C:\>Get-AzRecoveryServicesBackupContainer -ContainerType Windows -BackupManagementType MARS
41+
42+
```powershell
43+
PS C:\> $vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
44+
PS C:\> Get-AzRecoveryServicesBackupContainer -ContainerType Windows -BackupManagementType MARS -VaultId $vault.ID
3945
```
4046

4147
This command gets all Windows containers that are protected by Azure Backup agent.
42-
The *BackupManagementType* parameter is only required for Windows containers.
48+
The **BackupManagementType** parameter is only required for Windows containers.
4349

4450
## PARAMETERS
4551

4652
### -BackupManagementType
53+
4754
Specifies the backup management type.
4855
The acceptable values for this parameter are:
56+
4957
- AzureVM
5058
- MARS
5159
- AzureSQL
@@ -67,18 +75,21 @@ Accept wildcard characters: False
6775
```
6876
6977
### -ContainerType
78+
7079
Specifies the backup container type.
7180
The acceptable values for this parameter are:
72-
- AzureVM
81+
82+
- AzureVM
7383
- Windows
7484
- AzureSQL
7585
- AzureStorage
86+
- AzureVMAppContainer
7687
7788
```yaml
7889
Type: Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.ContainerType
7990
Parameter Sets: (All)
8091
Aliases:
81-
Accepted values: AzureVM, Windows, AzureSQL, AzureStorage, AzureWorkload
92+
Accepted values: AzureVM, Windows, AzureSQL, AzureStorage, AzureVMAppContainer
8293

8394
Required: True
8495
Position: 1
@@ -88,6 +99,7 @@ Accept wildcard characters: False
8899
```
89100
90101
### -DefaultProfile
102+
91103
The credentials, account, tenant, and subscription used for communication with azure.
92104
93105
```yaml
@@ -103,6 +115,7 @@ Accept wildcard characters: False
103115
```
104116
105117
### -FriendlyName
118+
106119
Specifies the friendly name of the container to get.
107120
108121
```yaml
@@ -118,6 +131,7 @@ Accept wildcard characters: False
118131
```
119132
120133
### -ResourceGroupName
134+
121135
Specifies the name of the resource group.
122136
This parameter is for Azure virtual machines only.
123137
@@ -134,8 +148,10 @@ Accept wildcard characters: False
134148
```
135149
136150
### -Status
151+
137152
Specifies the container registration status.
138153
The acceptable values for this parameter are:
154+
139155
- Registered
140156
141157
```yaml
@@ -152,6 +168,7 @@ Accept wildcard characters: False
152168
```
153169
154170
### -VaultId
171+
155172
ARM ID of the Recovery Services Vault.
156173
157174
```yaml
@@ -166,8 +183,9 @@ Accept pipeline input: True (ByValue)
166183
Accept wildcard characters: False
167184
```
168185
169-
### CommonParameters
170-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
186+
### -CommonParameters
187+
188+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
171189
172190
## INPUTS
173191
@@ -186,4 +204,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
186204
[Get-AzRecoveryServicesBackupManagementServer](./Get-AzRecoveryServicesBackupManagementServer.md)
187205
188206
[Unregister-AzRecoveryServicesBackupContainer](./Unregister-AzRecoveryServicesBackupContainer.md)
189-

src/RecoveryServices/RecoveryServices/help/Get-AzRecoveryServicesVault.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ schema: 2.0.0
99
# Get-AzRecoveryServicesVault
1010

1111
## SYNOPSIS
12+
1213
Gets a list of Recovery Services vaults.
1314

1415
## SYNTAX
@@ -19,26 +20,30 @@ Get-AzRecoveryServicesVault [-ResourceGroupName <String>] [-Name <String>]
1920
```
2021

2122
## DESCRIPTION
23+
2224
The **Get-AzRecoveryServicesVault** cmdlet gets a list of Recovery Services vaults in the current subscription.
2325

2426
## EXAMPLES
2527

2628
### Example 1
27-
```
29+
30+
```powershell
2831
PS C:\> Get-AzRecoveryServicesVault
2932
```
3033

3134
Get the list of vault in selected subscription.
3235

3336
### Example 2
34-
```
37+
38+
```powershell
3539
PS C:\> Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup"
3640
```
3741

3842
Get the list of vault in resource group in selected subscription.
3943

4044
### Example 3
41-
```
45+
46+
```powershell
4247
PS C:\> Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
4348
```
4449

@@ -47,6 +52,7 @@ Get the vault in resource group with given name.
4752
## PARAMETERS
4853

4954
### -DefaultProfile
55+
5056
The credentials, account, tenant, and subscription used for communication with azure.
5157

5258
```yaml
@@ -62,6 +68,7 @@ Accept wildcard characters: False
6268
```
6369
6470
### -Name
71+
6572
Specifies the name of the vault to query for.
6673
6774
```yaml
@@ -77,7 +84,8 @@ Accept wildcard characters: False
7784
```
7885
7986
### -ResourceGroupName
80-
Specifies the name of the Azure resource group in which to create or from which to retrieve the specified Recovery Services object.
87+
88+
Specifies the name of the Azure resource group from which to retrieve the specified Recovery Services object.
8189
8290
```yaml
8391
Type: System.String
@@ -91,8 +99,9 @@ Accept pipeline input: False
9199
Accept wildcard characters: False
92100
```
93101
94-
### CommonParameters
95-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
102+
### -CommonParameters
103+
104+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
96105
97106
## INPUTS
98107
@@ -111,5 +120,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
111120
[New-AzRecoveryServicesVault](./New-AzRecoveryServicesVault.md)
112121
113122
[Remove-AzRecoveryServicesVault](./Remove-AzRecoveryServicesVault.md)
114-
115-

src/RecoveryServices/RecoveryServices/help/Wait-AzRecoveryServicesBackupJob.md

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ schema: 2.0.0
99
# Wait-AzRecoveryServicesBackupJob
1010

1111
## SYNOPSIS
12+
1213
Waits for a Backup job to finish.
1314

1415
## SYNTAX
@@ -19,37 +20,29 @@ Wait-AzRecoveryServicesBackupJob [-Job] <Object> [[-Timeout] <Int64>] [-VaultId
1920
```
2021

2122
## DESCRIPTION
23+
2224
The **Wait-AzRecoveryServicesBackupJob** cmdlet waits for an Azure Backup job to finish.
2325
Backup jobs can take a long time.
2426
If you run a backup job as part of a script, you may want to force the script to wait for job to finish before it continues to other tasks.
2527
A script that includes this cmdlet can be simpler than one that polls the Backup service for the job status.
26-
Set the vault context by using the Set-AzRecoveryServicesVaultContext cmdlet before you use the current cmdlet.
28+
Set the vault context by using the -VaultId parameter.
2729

2830
## EXAMPLES
2931

3032
### Example 1: Wait for a job to finish
31-
```
32-
PS C:\>
33-
$Jobs = Get-AzRecoveryServicesBackupJob -Status InProgress
34-
$Job = $Jobs[0]
35-
while ( $Job.Status -ne Completed )
36-
{
37-
Write-Host "Waiting for completion..."
38-
Start-Sleep -Seconds 10
39-
$Job = Get-AzBackAzureRmRecoveryServicesBackupJob -Job $Job
40-
}
41-
Write-Host "Done!"
42-
Waiting for completion...
43-
Waiting for completion...
44-
Waiting for completion...
45-
Done!
33+
34+
```powershell
35+
PS C:\> $vault = Get-AzRecoveryServicesVault -ResourceGroupName "resourceGroup" -Name "vaultName"
36+
PS C:\> $Jobs = Get-AzRecoveryServicesBackupJob -Status InProgress -VaultId $vault.ID
37+
PS C:\> Wait-AzRecoveryServicesBackupJob -Job $Jobs[0] -VaultId $vault.ID -Timeout 3600
4638
```
4739

48-
This script polls the first job that is currently in progress until the job has completed.
40+
This script polls the first job that is currently in progress until the job has completed or timeout period of 1 hour expired.
4941

5042
## PARAMETERS
5143

5244
### -DefaultProfile
45+
5346
The credentials, account, tenant, and subscription used for communication with azure.
5447

5548
```yaml
@@ -65,6 +58,7 @@ Accept wildcard characters: False
6558
```
6659
6760
### -Job
61+
6862
Specifies the job to wait for.
6963
To obtain a **BackupJob** object, use the Get-AzRecoveryServicesBackupJob cmdlet.
7064
@@ -81,6 +75,7 @@ Accept wildcard characters: False
8175
```
8276
8377
### -Timeout
78+
8479
Specifies the maximum time, in seconds, that this cmdlet waits for the job to finish.
8580
It is recommended to specify a time-out value.
8681
@@ -97,6 +92,7 @@ Accept wildcard characters: False
9792
```
9893
9994
### -VaultId
95+
10096
ARM ID of the Recovery Services Vault.
10197
10298
```yaml
@@ -111,8 +107,9 @@ Accept pipeline input: True (ByValue)
111107
Accept wildcard characters: False
112108
```
113109
114-
### CommonParameters
115-
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).
110+
### -CommonParameters
111+
112+
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
116113
117114
## INPUTS
118115
@@ -129,5 +126,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
129126
## RELATED LINKS
130127
131128
[Get-AzRecoveryServicesBackupJob](./Get-AzRecoveryServicesBackupJob.md)
132-
133-

0 commit comments

Comments
 (0)