diff --git a/src/Compute/Compute/ChangeLog.md b/src/Compute/Compute/ChangeLog.md index a41fc005bfed..b0eea838e1a0 100644 --- a/src/Compute/Compute/ChangeLog.md +++ b/src/Compute/Compute/ChangeLog.md @@ -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. diff --git a/src/Compute/Compute/RestorePoints/NewAzRestorePoint.cs b/src/Compute/Compute/RestorePoints/NewAzRestorePoint.cs index df6353273f44..705a52ae9196 100644 --- a/src/Compute/Compute/RestorePoints/NewAzRestorePoint.cs +++ b/src/Compute/Compute/RestorePoints/NewAzRestorePoint.cs @@ -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(); @@ -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(); diff --git a/src/Compute/Compute/help/New-AzRestorePoint.md b/src/Compute/Compute/help/New-AzRestorePoint.md index 5f248335ecae..307a13c11e38 100644 --- a/src/Compute/Compute/help/New-AzRestorePoint.md +++ b/src/Compute/Compute/help/New-AzRestorePoint.md @@ -14,7 +14,7 @@ This cmdlet can create a New Restore Point ``` New-AzRestorePoint [-ResourceGroupName] [-RestorePointCollectionName] [-Name] - [[-Location] ] [-RestorePointId ] [-DisksToExclude ] + [[-Location] ] [-RestorePointId ] [-DisksToExclude ] [-ConsistencyMode ] [-DefaultProfile ] [-WhatIf] [-Confirm] [] ``` @@ -25,13 +25,28 @@ Create's a new Restore Point ### Example 1 ```powershell -New-AzRestorePoint -ResourceGroupName -RestorePointCollectionName -Name [-DisksToExclude] +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.