Skip to content

Commit 0322f7f

Browse files
committed
updated help files
1 parent b925475 commit 0322f7f

6 files changed

+65
-24
lines changed

src/RecoveryServices/RecoveryServices.Backup/Cmdlets/Item/GetAzureRMRecoveryServicesBackupProtectableItem.cs

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ public class GetAzureRmRecoveryServicesBackupProtectableItem : RSBackupVaultCmdl
3636
internal const string FilterParamSet = "FilterParamSet";
3737
internal const string IdParamSet = "IdParamSet";
3838

39-
[Parameter(Mandatory = true, Position = 0, ParameterSetName = NoFilterParamSet,
39+
[Parameter(Mandatory = false, Position = 0, ParameterSetName = NoFilterParamSet,
4040
HelpMessage = ParamHelpMsgs.Item.Container, ValueFromPipelineByPropertyName = true)]
41-
[Parameter(Mandatory = true, Position = 0, ParameterSetName = FilterParamSet,
41+
[Parameter(Mandatory = false, Position = 0, ParameterSetName = FilterParamSet,
4242
HelpMessage = ParamHelpMsgs.Item.Container, ValueFromPipelineByPropertyName = true)]
4343
[ValidateNotNullOrEmpty]
4444
public ContainerBase Container { get; set; }
@@ -74,9 +74,10 @@ public override void ExecuteCmdlet()
7474

7575
string backupManagementType = "";
7676
string workloadType = "";
77-
string containerName = "";
77+
ODataQuery<BMSPOQueryObject> queryParam = null;
7878
if (ParameterSetName == IdParamSet)
7979
{
80+
string containerName = "";
8081
Dictionary<UriEnums, string> keyValueDict = HelperUtils.ParseUri(ParentID);
8182
containerName = HelperUtils.GetContainerUri(keyValueDict, ParentID);
8283
if (containerName.Split(new string[] { ";" }, System.StringSplitOptions.None)[0].ToLower() == "vmappcontainer")
@@ -89,18 +90,37 @@ public override void ExecuteCmdlet()
8990
{
9091
workloadType = ServiceClientModel.WorkloadType.SQLDataBase;
9192
}
93+
queryParam = new ODataQuery<BMSPOQueryObject>(
94+
q => q.BackupManagementType
95+
== backupManagementType &&
96+
q.WorkloadType == workloadType &&
97+
q.ContainerName == containerName);
9298
}
9399
else
94100
{
95-
backupManagementType = Container.BackupManagementType.ToString();
96-
workloadType = ConversionUtils.GetServiceClientWorkloadType(WorkloadType.ToString());
97-
containerName = Container.Name;
101+
if(Container != null)
102+
{
103+
string containerName = "";
104+
backupManagementType = Container.BackupManagementType.ToString();
105+
workloadType = ConversionUtils.GetServiceClientWorkloadType(WorkloadType.ToString());
106+
containerName = Container.Name;
107+
queryParam = new ODataQuery<BMSPOQueryObject>(
108+
q => q.BackupManagementType
109+
== backupManagementType &&
110+
q.WorkloadType == workloadType &&
111+
q.ContainerName == containerName);
112+
}
113+
else
114+
{
115+
backupManagementType = "AzureWorkload";
116+
workloadType = ConversionUtils.GetServiceClientWorkloadType(WorkloadType.ToString());
117+
queryParam = new ODataQuery<BMSPOQueryObject>(
118+
q => q.BackupManagementType
119+
== backupManagementType &&
120+
q.WorkloadType == workloadType);
121+
}
98122
}
99-
ODataQuery<BMSPOQueryObject> queryParam = new ODataQuery<BMSPOQueryObject>(
100-
q => q.BackupManagementType
101-
== backupManagementType &&
102-
q.WorkloadType == workloadType &&
103-
q.ContainerName == containerName);
123+
104124

105125
WriteDebug("going to query service to get list of protectable items");
106126
List<WorkloadProtectableItemResource> protectableItems =

src/RecoveryServices/RecoveryServices/help/Disable-AzRecoveryServicesBackupAutoProtection.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ The **Disable-AzRecoveryServicesBackupAutoProtection** cmdlet disables protectio
2525

2626
### Example 1
2727
```
28-
PS C:\> Disable-AzRecoveryServicesAutoProtection -BackupManagementType “AzureWorkload” -WorkloadType “MSSQL” -InputItem <$ItemID> -VaultId $vault.ID
28+
PS C:\> $container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVMAppContainer
29+
PS C:\> Get-AzRecoveryServicesBackupProtectableItem -Container $container -WorkloadType "MSSQL" -ItemType "SQLInstance" | Disable-AzRecoveryServicesBackupAutoProtection -BackupManagementType "AzureWorkload" -WorkloadType "MSSQL"
2930
```
3031

3132
The first cmdlet disables the Backup protection policy.

src/RecoveryServices/RecoveryServices/help/Enable-AzRecoveryServicesBackupAutoProtection.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ The **Enable-AzRecoveryServicesBackupAutoProtection** cmdlet sets Azure auto Bac
2727
### Example 1
2828
```
2929
PS C:\> $Pol = Get-AzRecoveryServicesBackupProtectionPolicy -Name "DefaultPolicy"
30-
PS C:\> Enable-AzRecoveryServicesAutoProtection -BackupManagementType "AzureWorkload" -WorkloadType "MSSQL" -InputItem <$Item> -Policy $Pol -VaultId $vault.ID
30+
PS C:\> $container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureVMAppContainer
31+
PS C:\> Get-AzRecoveryServicesBackupProtectableItem -Container $container -WorkloadType "MSSQL" -ItemType "SQLInstance" | Enable-AzRecoveryServicesBackupAutoProtection -BackupManagementType "AzureWorkload" -WorkloadType "MSSQL" -Policy $Pol
3132
```
3233

3334
The first cmdlet gets a default policy object, and then stores it in the $Pol variable.

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

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,23 @@ Get protectable items from a container.
1414

1515
### NoFilterParamSet (Default)
1616
```
17-
Get-AzRecoveryServicesBackupProtectableItem [-Container] <ContainerBase> [-WorkloadType] <WorkloadType>
17+
Get-AzRecoveryServicesBackupProtectableItem [[-Container] <ContainerBase>] [-WorkloadType] <WorkloadType>
1818
[-VaultId <String>] [-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
1919
```
2020

2121
### FilterParamSet
2222
```
23-
Get-AzRecoveryServicesBackupProtectableItem [-Container] <ContainerBase> [-WorkloadType] <WorkloadType>
23+
Get-AzRecoveryServicesBackupProtectableItem [[-Container] <ContainerBase>] [-WorkloadType] <WorkloadType>
2424
[[-ItemType] <ProtectableItemType>] [-VaultId <String>] [-DefaultProfile <IAzureContextContainer>]
2525
[<CommonParameters>]
2626
```
2727

28+
### IdParamSet
29+
```
30+
Get-AzRecoveryServicesBackupProtectableItem [-ParentID] <String> [-VaultId <String>]
31+
[-DefaultProfile <IAzureContextContainer>] [<CommonParameters>]
32+
```
33+
2834
## DESCRIPTION
2935
The **Get-AzRecoveryServicesBackupProtectableItem** cmdlet gets the protectable items in a container or a value in Azure Backup and the protection status of the items.
3036
A container that is registered to an Azure Recovery Services vault can have one or more items that can be protected.
@@ -34,7 +40,7 @@ A container that is registered to an Azure Recovery Services vault can have one
3440
### Example 1
3541
```
3642
PS C:\>$Container = Get-AzRecoveryServicesBackupContainer -ContainerType MSSQL -Status Registered
37-
PS C:\> $Item = Get-AzRecoveryServicesProtectableItem -Container $Container -ItemType SQLDatabase -VaultId $vault.ID
43+
PS C:\> $Item = Get-AzRecoveryServicesProtectableItem -Container $Container -ItemType "SQLDatabase" -VaultId $vault.ID
3844
```
3945

4046
The first command gets the container of type MSSQL, and then stores it in the $Container variable.
@@ -47,10 +53,10 @@ Container where the item resides
4753

4854
```yaml
4955
Type: Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.ContainerBase
50-
Parameter Sets: (All)
56+
Parameter Sets: NoFilterParamSet, FilterParamSet
5157
Aliases:
5258

53-
Required: True
59+
Required: False
5460
Position: 0
5561
Default value: None
5662
Accept pipeline input: True (ByPropertyName)
@@ -88,6 +94,21 @@ Accept pipeline input: False
8894
Accept wildcard characters: False
8995
```
9096
97+
### -ParentID
98+
Parent ID
99+
100+
```yaml
101+
Type: System.String
102+
Parameter Sets: IdParamSet
103+
Aliases:
104+
105+
Required: True
106+
Position: 0
107+
Default value: None
108+
Accept pipeline input: True (ByPropertyName)
109+
Accept wildcard characters: False
110+
```
111+
91112
### -VaultId
92113
ARM ID of the Recovery Services Vault.
93114
@@ -108,7 +129,7 @@ Workload type of the resource (for example: AzureVM, WindowsServer, AzureFiles).
108129
109130
```yaml
110131
Type: Microsoft.Azure.Commands.RecoveryServices.Backup.Cmdlets.Models.WorkloadType
111-
Parameter Sets: (All)
132+
Parameter Sets: NoFilterParamSet, FilterParamSet
112133
Aliases:
113134
Accepted values: AzureVM, AzureSQLDatabase, AzureFiles, MSSQL
114135

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ After an item has been backed up, an **AzRecoveryServicesBackupRecoveryLogChain*
3535
PS C:\> $StartDate = (Get-Date).AddDays(-7)
3636
PS C:\> $EndDate = Get-Date
3737
PS C:\> $Container = Get-AzRecoveryServicesBackupContainer -ContainerType AzureWorkload -Status Registered
38-
PS C:\> $BackupItem = Get-AzRecoveryServicesBackupItem -Container $Container -WorkloadType MSSQL
39-
PS C:\> $RP = Get-AzRecoveryServicesBackupRecoveryLogChain -Item $BackupItem -StartDate $Startdate.ToUniversalTime() -EndDate $Enddate.ToUniversalTime()
38+
PS C:\> $RP = Get-AzRecoveryServicesBackupItem -Container $Container -WorkloadType MSSQL | Get-AzRecoveryServicesBackupRecoveryLogChain -StartDate $Startdate.ToUniversalTime() -EndDate $Enddate.ToUniversalTime()
4039
```
4140

4241
The first command gets the date from seven days ago, and then stores it in the $StartDate variable.

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ The command returns a recovery config for AzureWorkload items which is passed to
3535

3636
### Example 1
3737
```
38-
PS C:\> $RP = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate
39-
PS C:\> $SQLRecoveryObject = Get-AzRecoveryServicesWorkloadRecoveryConfig -RecoveryPoint $RP -OriginalWorkloadRestore
40-
PS C:\> $SQLRecoveryObject = Get-AzRecoveryServicesWorkloadRecoveryConfig -RecoveryPoint $RP -AlternateWorkloadRestore -TargetItem $SQLProtItem
38+
PS C:\> $SQLRecoveryObject = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate | Get-AzRecoveryServicesWorkloadRecoveryConfig -OriginalWorkloadRestore
39+
PS C:\> $SQLRecoveryObject = Get-AzRecoveryServicesBackupRecoveryPoint -Item $SQLBkpItem $startdate $enddate | Get-AzRecoveryServicesWorkloadRecoveryConfig -AlternateWorkloadRestore -TargetItem $SQLProtItem
4140
```
4241

4342
The first cmdlet is used to get the Recovery point object.

0 commit comments

Comments
 (0)