Skip to content

Commit bca8db5

Browse files
New-AzSshKey should log to Warning stream instead of console (#16988)
* Changed Console.WriteLine to Warning stream output * New-AzureSshKey change added for key file logging * Moved change to Upcoming Release * Update src/Compute/Compute/ChangeLog.md Co-authored-by: Yunchi Wang <[email protected]>
1 parent 6e0717f commit bca8db5

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Compute/Compute/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
2121
-->
2222
## Upcoming Release
23+
* Updated `New-AzSshKey` cmdlet to write file paths to generated keys to the Warning stream instead of the console.
2324

2425
## Version 4.23.0
2526
* Remove ProvisioningDetails property from PSRestorePoint object.

src/Compute/Compute/Usage/NewAzureSshKey.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ public override void ExecuteCmdlet()
7979
{
8080
writer.WriteLine(keypair.PrivateKey);
8181
}
82-
Console.WriteLine("Private key is saved to " + privateKeyFilePath);
82+
WriteWarning("Private key is saved to " + privateKeyFilePath);
8383

8484
using (StreamWriter writer = new StreamWriter(publicKeyFilePath))
8585
{
8686
writer.WriteLine(keypair.PublicKey);
8787
}
88-
Console.WriteLine("Public key is saved to " + publicKeyFilePath);
88+
WriteWarning("Public key is saved to " + publicKeyFilePath);
8989
}
9090

9191
var psObject = new PSSshPublicKeyResource();

0 commit comments

Comments
 (0)