Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

[Eng]: Improve error message related to the use of the UbutntuLTS alias #23581

Closed dcaro closed 1 week ago

dcaro commented 11 months ago

Description

The error message returned when using the 'UbuntuLTS' alias is not very explicit:

New-AzVM -ResourceGroupName <ResourceGroupName> -Name myVM -Image UbuntuLTS -Credential (Get-Credential)
New-AzVM: Can't find the image 'ubuntults'.

Can we use something similar to:

Invalid image "ubuntults". Use a valid image URN, custom image name, custom image id, VHD blob URI, or pick an image from ['CentOS85Gen2', 'Debian11', 'FlatcarLinuxFreeGen2', 'OpenSuseLeap154Gen2', 'RHELRaw8LVMGen2', 'SuseSles15SP3', 'Ubuntu2204', 'Win2022Datacenter', 'Win2022AzureEditionCore', 'Win2019Datacenter', 'Win2016Datacenter', 'Win2012R2Datacenter', 'Win2012Datacenter', 'Win2008R2SP1'].

microsoft-github-policy-service[bot] commented 11 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Drewm3, @TravisCragg-MSFT, @nikhilpatel909, @sandeepraichura, @hilaryw29, @GabstaMSFT.

TravisCragg-MSFT commented 11 months ago

@dcaro Thanks for the feedback! I am involving our PS team for more information.

haagha commented 1 week ago

This should be addressed by @grizzlytheodore changes. @dcaro can you check again and close this issue.

dcaro commented 1 week ago

It would better to display the list of aliases in the output of the command rather than having to go to our docs but the implemented solution works.