Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add param to New-AzRestorePoint #20645

Merged
merged 3 commits into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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