Redigera

Dela via


Set-AzVmssUefi

Modifies UEFI properties of gen 2 virtual machines that are part of virtual machine scale sets

Syntax

Set-AzVmssUefi
   [-VirtualMachineScaleSet] <PSVirtualMachineScaleSet>
   [[-EnableVtpm] <Boolean>]
   [[-EnableSecureBoot] <Boolean>]
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

The Set-AzVmssUefi cmdlet modifies UEFI properties of virtual machines in a virtual machine scale set.

Examples

Example 1

$VMSS = Get-AzVmss -ResourceGroupName "ResourceGroup11" -VMScaleSetName "ContosoVM07"
Set-AzVmssUefi -VirtualMachineScaleSet $VMSS -EnableVtpm $true -EnableSecureBoot $true

The first command gets the virtual machine scale set named ContosoVM07 by using Get-AzVmss. The command stores it in the $VMSS variable. The second command modifies the UEFI settings to enable SecureBoot and vTPM on virtual machines in $VMSS. The command passes the result to the Update-AzVmss cmdlet, which implements your changes. A change to the cashing mode causes the virtual machine to restart.

Parameters

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-EnableSecureBoot

Parameter to toggle secure boot on the VMs of the scale set

Type:Boolean
Position:2
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-EnableVtpm

Parameter to toggle vTPM on the VMs of the scale set

Type:Boolean
Position:1
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-VirtualMachineScaleSet

The virtual machine scale set profile.

Type:PSVirtualMachineScaleSet
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

Inputs

PSVirtualMachineScaleSet

Boolean

Outputs

PSVirtualMachineScaleSet