Skip to content

Commit b5de2a7

Browse files
grizzlytheodoreTheodore Chang
andauthored
add param to New-AzRestorePoint (#20645)
* update * changelog * update for fulltypename Co-authored-by: Theodore Chang <[email protected]>
1 parent d1d0f71 commit b5de2a7

File tree

3 files changed

+28
-2
lines changed

3 files changed

+28
-2
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
2121
-->
2222
## Upcoming Release
23+
* Added `ConsistencyMode` parameter to `New-AzRestorePoint`
2324

2425
## Version 5.3.0
2526
* Removed the image `Win2008R2SP1` from the list of available images and documentation. This image is no longer available on the backend so the client tools need to sync to that change.

src/Compute/Compute/RestorePoints/NewAzRestorePoint.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,14 @@ public class NewAzureRestorePoint : ComputeAutomationBaseCmdlet
7272
public string[] DisksToExclude { get; set; }
7373

7474

75+
[Parameter(
76+
Mandatory = false,
77+
ValueFromPipeline = true,
78+
HelpMessage = "ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details.")]
79+
[PSArgumentCompleter("CrashConsistent", "FileSystemConsistent", "ApplicationConsistent")]
80+
public string ConsistencyMode { get; set; }
81+
82+
7583
public override void ExecuteCmdlet()
7684
{
7785
base.ExecuteCmdlet();
@@ -102,6 +110,8 @@ public override void ExecuteCmdlet()
102110
restorePoint.ExcludeDisks = disksExclude;
103111
}
104112

113+
restorePoint.ConsistencyMode = this.ConsistencyMode;
114+
105115
var result = RestorePointClient.Create(resourceGroup, restorePointCollectionName, restorePointName, restorePoint);
106116

107117
var psObject = new PSRestorePoint();

src/Compute/Compute/help/New-AzRestorePoint.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ This cmdlet can create a New Restore Point
1414

1515
```
1616
New-AzRestorePoint [-ResourceGroupName] <String> [-RestorePointCollectionName] <String> [-Name] <String>
17-
[[-Location] <String>] [-RestorePointId <String>] [-DisksToExclude <String[]>]
17+
[[-Location] <String>] [-RestorePointId <String>] [-DisksToExclude <String[]>] [-ConsistencyMode <String>]
1818
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
1919
```
2020

@@ -25,13 +25,28 @@ Create's a new Restore Point
2525

2626
### Example 1
2727
```powershell
28-
New-AzRestorePoint -ResourceGroupName <String> -RestorePointCollectionName <String> -Name <String> [-DisksToExclude] <String[]>
28+
New-AzRestorePoint -ResourceGroupName "myRG" -RestorePointCollectionName "myCollection" -Name "myRestorePoint" -ConsistencyMode "CrashConsistent"
2929
```
3030

3131
Creates a new Restore Point
3232

3333
## PARAMETERS
3434

35+
### -ConsistencyMode
36+
ConsistencyMode of the RestorePoint. Can be specified in the input while creating a restore point. For now, only CrashConsistent is accepted as a valid input. Please refer to https://aka.ms/RestorePoints for more details.
37+
38+
```yaml
39+
Type: System.String
40+
Parameter Sets: (All)
41+
Aliases:
42+
43+
Required: False
44+
Position: Named
45+
Default value: None
46+
Accept pipeline input: True (ByValue)
47+
Accept wildcard characters: False
48+
```
49+
3550
### -DefaultProfile
3651
The credentials, account, tenant, and subscription used for communication with Azure.
3752

0 commit comments

Comments
 (0)