Skip to content

Commit

Permalink
add param to New-AzRestorePoint (#20645)
Browse files Browse the repository at this point in the history
* update

* changelog

* update for fulltypename

Co-authored-by: Theodore Chang <theodore.l.chang@gmail.com>
  • Loading branch information
grizzlytheodore and Theodore Chang authored Jan 19, 2023
1 parent d1d0f71 commit b5de2a7
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
-->
## Upcoming Release
* Added `ConsistencyMode` parameter to `New-AzRestorePoint`

## Version 5.3.0
* 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.
Expand Down
10 changes: 10 additions & 0 deletions src/Compute/Compute/RestorePoints/NewAzRestorePoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ public class NewAzureRestorePoint : ComputeAutomationBaseCmdlet
public string[] DisksToExclude { get; set; }


[Parameter(
Mandatory = false,
ValueFromPipeline = true,
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.")]
[PSArgumentCompleter("CrashConsistent", "FileSystemConsistent", "ApplicationConsistent")]
public string ConsistencyMode { get; set; }


public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();
Expand Down Expand Up @@ -102,6 +110,8 @@ public override void ExecuteCmdlet()
restorePoint.ExcludeDisks = disksExclude;
}

restorePoint.ConsistencyMode = this.ConsistencyMode;

var result = RestorePointClient.Create(resourceGroup, restorePointCollectionName, restorePointName, restorePoint);

var psObject = new PSRestorePoint();
Expand Down
19 changes: 17 additions & 2 deletions src/Compute/Compute/help/New-AzRestorePoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ This cmdlet can create a New Restore Point

```
New-AzRestorePoint [-ResourceGroupName] <String> [-RestorePointCollectionName] <String> [-Name] <String>
[[-Location] <String>] [-RestorePointId <String>] [-DisksToExclude <String[]>]
[[-Location] <String>] [-RestorePointId <String>] [-DisksToExclude <String[]>] [-ConsistencyMode <String>]
[-DefaultProfile <IAzureContextContainer>] [-WhatIf] [-Confirm] [<CommonParameters>]
```

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

### Example 1
```powershell
New-AzRestorePoint -ResourceGroupName <String> -RestorePointCollectionName <String> -Name <String> [-DisksToExclude] <String[]>
New-AzRestorePoint -ResourceGroupName "myRG" -RestorePointCollectionName "myCollection" -Name "myRestorePoint" -ConsistencyMode "CrashConsistent"
```

Creates a new Restore Point

## PARAMETERS

### -ConsistencyMode
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.

```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
```
### -DefaultProfile
The credentials, account, tenant, and subscription used for communication with Azure.
Expand Down

0 comments on commit b5de2a7

Please sign in to comment.