Skip to content

[Compute] Autogen PR Issue 6 #42

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -20,6 +20,14 @@

-->
## Upcoming Release
* Syntax changes for better clarity and understanding.
- Edits made to existing cmdlets and parameters.
- New cmdlets and parameters added.
* New cmdlet Set-AzDiskSecurityProfile added.
- New parameter GallantSecurity added to Set-AzDiskSecurityProfile.
- GallantSecurity is a string type and can only have the values DiskOn, VMOn, or SecurityOff.
* Fixed `New-AzVmss` to correctly work when using `-EdgeZone` by creating the Load Balancer in the correct edge zone.
* Removed references to image aliases in `New-AzVM` and `New-AzVmss` to images that were removed.
* Fixed `New-AzVmss` to correctly work when using `-EdgeZone` by creating the Load Balancer in the correct edge zone.
* Removed references to image aliases in `New-AzVM` and `New-AzVmss` to images that were removed.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// ----------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------
//
// Copyright Microsoft Corporation
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -54,6 +54,13 @@ public class SetAzDiskSecurityProfile : Microsoft.Azure.Commands.ResourceManager
HelpMessage = "ResourceId of the disk encryption set to use for enabling encryption at rest.")]
public string SecureVMDiskEncryptionSet { get; set; }

[Parameter(
Mandatory = true,
ValueFromPipelineByPropertyName = true,
HelpMessage = "GallantSecurity property. Possible values include: DiskOn, VMOn, SecurityOff")]
[PSArgumentCompleter("DiskOn", "VMOn", "SecurityOff")]
public string GallantSecurity { get; set; }

protected override void ProcessRecord()
{
if (ShouldProcess("DiskSecurityProfile", "Set"))
@@ -94,8 +101,18 @@ private void Run()
this.Disk.SecurityProfile.SecureVMDiskEncryptionSetId = this.SecureVMDiskEncryptionSet;
}

if (this.IsParameterBound(c => c.GallantSecurity))
{
if (this.Disk.SecurityProfile == null)
{
this.Disk.SecurityProfile = new DiskSecurityProfile();
}
this.Disk.SecurityProfile.GallantSecurity = this.GallantSecurity;
}

WriteObject(this.Disk);
}
}

}
}

11 changes: 9 additions & 2 deletions src/Compute/Compute/Generated/Models/PSDisk.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//
//
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -80,4 +80,11 @@ public string ResourceGroupName
public double? CompletionPercent { get; set; }
public bool? OptimizedForFrequentAttach { get; set; }
}
}

public partial class DiskSecurityProfile
{
public string SecurityType { get; set; }
public string SecureVMDiskEncryptionSetId { get; set; }
public string GallantSecurity { get; set; }
}
}
Loading