Skip to content

Commit f272be6

Browse files
update code
1 parent 9aa5ec1 commit f272be6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Compute/Compute/VirtualMachine/Operation/NewAzureVMCommand.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ public async Task<ResourceConfig<VirtualMachine>> CreateConfigAsync()
444444

445445

446446
List<SshPublicKey> sshPublicKeyList = new List<SshPublicKey>();
447-
if (_cmdlet.ConfigAsyncVisited == true && (_cmdlet.SshKeyName != null || _cmdlet.GenerateSshKey == true))
447+
if (_cmdlet.SshKeyName != null || _cmdlet.GenerateSshKey == true)
448448
{
449449
if (ImageAndOsType?.OsType != OperatingSystemTypes.Linux)
450450
{
@@ -1071,6 +1071,10 @@ private static string GetStorageAccountNameFromUriString(string uriStr)
10711071

10721072
private string SshKeyForLinux()
10731073
{
1074+
if (this.ConfigAsyncVisited == true)
1075+
{
1076+
this.GenerateSshKey = false;
1077+
}
10741078

10751079
if (this.GenerateSshKey.IsPresent && ! this.IsParameterBound(c => c.SshKeyName))
10761080
{

0 commit comments

Comments
 (0)