Skip to content

Commit

Permalink
AKS - create .ssh folder before creating ssh public key (Azure#20054)
Browse files Browse the repository at this point in the history
  • Loading branch information
YanaXu authored Nov 9, 2022
1 parent bd229af commit ceab374
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Aks/Aks/Commands/NewAzureRmAks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,11 @@ private void PreValidate()

private string GenerateSshKeyValue()
{
String generateSshKeyPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".ssh", "id_rsa"); ;
String generateSshKeyFolder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".ssh");
if (!Directory.Exists(generateSshKeyFolder)) {
Directory.CreateDirectory(generateSshKeyFolder);
}
String generateSshKeyPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".ssh", "id_rsa");
if (File.Exists(generateSshKeyPath))
{
throw new AzPSArgumentException(
Expand Down

0 comments on commit ceab374

Please sign in to comment.