Skip to content

Commit 24feea0

Browse files
author
Samuel Anudeep
committed
Updated help, change log and fixed tests.
1 parent ea2132d commit 24feea0

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Backup.Test/ScenarioTests/IaasVm/ProtectionCheckTests.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,22 @@ function Test-AzureVMProtectionCheck
2828
-Type AzureVM
2929

3030
Assert-NotNull $status
31-
Assert-False $status.BackedUp
31+
Assert-False { $status.BackedUp }
3232

3333
$vault = Create-RecoveryServicesVault $resourceGroupName $location
3434
Enable-Protection $vault $vm
3535

3636
$status = Get-AzureRmRecoveryServicesBackupStatus -ResourceId $vm.Id
3737
Assert-NotNull $status
38-
Assert-True $status.BackedUp
39-
Assert-True { $status.VaultId -eq $vaultId }
38+
Assert-True { $status.BackedUp }
39+
Assert-True { $status.VaultId -eq $vault.ID }
4040

4141
Delete-Vault $vault
4242

4343
$status = Get-AzureRmRecoveryServicesBackupStatus -ResourceId $vm.Id
4444

4545
Assert-NotNull $status
46-
Assert-False $status.BackedUp
46+
Assert-False { $status.BackedUp }
4747
}
4848
finally
4949
{

src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Backup/ChangeLog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
-->
2020
## Current Release
2121
* Fixed formatting of OutputType in help files
22-
* Added Get-AzureRmRecoveryServicesBackupStatus cmdlet. This cmdlet takes a VM ID and returns null (if this VM is not protected by any vault in the subscription) and the vault name (if the VM is protected by some vault).
22+
* Added Get-AzureRmRecoveryServicesBackupStatus cmdlet. This cmdlet takes a VM ID and checks if the VM is protected by some vault in the subscription. If there exists such a vault, the cmdlet outputs the vault details.
2323

2424
## Version 4.2.0
2525
* Added -Vault parameter to RecoveryServices.Backup cmdlets. When passed, this will override the Set-AzureRmRecoveryServicesContext cmdlet.

src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Backup/help/AzureRM.RecoveryServices.Backup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Downloads a script to mount all the files of the recovery point.
5454
Gets a base schedule policy object.
5555

5656
### [Get-AzureRmRecoveryServicesBackupStatus](Get-AzureRmRecoveryServicesBackupStatus.md)
57-
The command returns null/empty if the specified resource is not protected under any Recovery Services vault in the subscription. If it is protected, the relevant vault details will be returned.
57+
Checks whether your ARM resource is backed up or not.
5858

5959
### [New-AzureRmRecoveryServicesBackupProtectionPolicy](New-AzureRmRecoveryServicesBackupProtectionPolicy.md)
6060
Creates a Backup protection policy.

src/ResourceManager/RecoveryServices/Commands.RecoveryServices.Backup/help/Get-AzureRmRecoveryServicesBackupStatus.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
external help file: Microsoft.Azure.Commands.RecoveryServices.Backup.dll-Help.xml
3-
online version:
3+
online version: https://docs.microsoft.com/en-us/powershell/module/azurerm.recoveryservices.backup/get-azurermrecoveryservicesbackupstatus
44
schema: 2.0.0
55
---
66

@@ -14,12 +14,13 @@ Checks whether your ARM resource is backed up or not.
1414
### Name (Default)
1515
```
1616
Get-AzureRmRecoveryServicesBackupStatus -Name <String> -ResourceGroupName <String> -Type <String>
17-
[-DefaultProfile <IAzureContextContainer>]
17+
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
1818
```
1919

2020
### Id
2121
```
2222
Get-AzureRmRecoveryServicesBackupStatus -ResourceId <String> [-DefaultProfile <IAzureContextContainer>]
23+
[<CommonParameters>]
2324
```
2425

2526
## DESCRIPTION
@@ -30,16 +31,14 @@ If it is protected, the relevant vault details will be returned.
3031

3132
### Example 1
3233
```
33-
PS C:\> $isVMBackedUp = Get-AzureRmRecoveryServicesBackupStatus -Name myAzureVM -ResourceGroupName myAzureVMRG -ResourceType AzureVM
34-
PS C:\> If ($isVMBackedUp -eq “”) {
35-
Get-AzureRmRecoveryServicesVault -Name "testvault" -ResourceGroupName "vaultResourceGroup" | Set-AzureRmRecoveryServicesVaultContext
36-
$defPolicy = Get-AzureRmRecoveryServicesBackupProtectionPolicy -WorkloadType "AzureVM"
37-
Enable-AzureRmRecoveryServicesBackupProtection -Policy $defpol -Name "myAzureVM" -ResourceGroupName "myAzureVMRG"
34+
PS C:\> $status = Get-AzureRmRecoveryServicesBackupStatus -Name "myAzureVM" -ResourceGroupName "myAzureVMRG" -ResourceType "AzureVM"
35+
PS C:\> If ($status.BackedUp -eq $false) {
36+
$vault = Get-AzureRmRecoveryServicesVault -Name "testvault" -ResourceGroupName "vaultResourceGroup"
37+
$defPolicy = Get-AzureRmRecoveryServicesBackupProtectionPolicy -Vault $vault -WorkloadType "AzureVM"
38+
Enable-AzureRmRecoveryServicesBackupProtection -Vault $vault -Policy $defpol -Name "myAzureVM" -ResourceGroupName "myAzureVMRG"
3839
}
3940
```
4041

41-
{{ Add example description here }}
42-
4342
## PARAMETERS
4443

4544
### -DefaultProfile
@@ -118,15 +117,16 @@ Accept pipeline input: False
118117
Accept wildcard characters: False
119118
```
120119
120+
### CommonParameters
121+
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).
122+
121123
## INPUTS
122124
123125
### System.String
124126
125-
126127
## OUTPUTS
127128
128-
### System.String
129-
129+
### Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.ResourceBackupStatus
130130
131131
## NOTES
132132

0 commit comments

Comments
 (0)