Skip to content

Commit

Permalink
Added information on how to find VM Images when using New-AzVM with -…
Browse files Browse the repository at this point in the history
…Image parameter. (Azure#25779)

* write information when -image is used

* change

---------

Co-authored-by: Theodore Chang <[email protected]>
Co-authored-by: Xiaogang <[email protected]>
  • Loading branch information
3 people authored Aug 12, 2024
1 parent c6bff79 commit 6de23b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Compute/Compute/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
-->
## Upcoming Release
* Added information on how to find VM Images when using `New-AzVM` with `-Image` parameter.
* Added `TimeCreated` read-only field to `PSVirtualMachineScaleSetVMProfile` object.
* Added parameter `-ResourceIdsOnly` to `Get-AzCapacityReservationGroup` cmdlet.
* Changed the `Set-AzVMOperatingSystem` cmdlet when the `-VM` parameter is used without an OSProfile. Now it will not throw a null reference exception when `-Credential` is not provided.
Expand Down
1 change: 1 addition & 0 deletions src/Compute/Compute/Common/ConstantStringTypes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ public static class HelpMessages
public const string VMPlanPublisher = "The publisher ID";

public const string TrustedLaunchUpgradeMessage = "Consider upgrading security for your workloads using Azure Trusted Launch VMs. To know more about Trusted Launch, please visit https://aka.ms/TrustedLaunch";
public const string PSVMImageMessage = "You can reference https://aka.ms/findImagePS on how to find VM Images using PowerShell.";
}

public static class ValidateSetValues
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,11 @@ async Task StrategyExecuteCmdletAsync(IAsyncCmdlet asyncCmdlet)
PublicIpAddressName = PublicIpAddressName;
SecurityGroupName = SecurityGroupName ?? Name;

if (this.IsParameterBound(c => c.Image))
{
WriteInformation(HelpMessages.PSVMImageMessage, new string[] { "PSHOST" });
}

// Check TrustedLaunch UEFI values defaulting
if (this.IsParameterBound(c => c.SecurityType)
&& this.SecurityType != null)
Expand Down

0 comments on commit 6de23b6

Please sign in to comment.