Edit

Share via


Set-AzVMBootDiagnostic

Modifies boot diagnostics properties of a virtual machine.

Syntax

EnableBootDiagnostics

Set-AzVMBootDiagnostic
    [-VM] <PSVirtualMachine>
    [[-ResourceGroupName] <String>]
    [[-StorageAccountName] <String>]
    [-Enable]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

DisableBootDiagnostics

Set-AzVMBootDiagnostic
    [-VM] <PSVirtualMachine>
    [-Disable]
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Set-AzVMBootDiagnostic cmdlet modifies boot diagnostics properties of a virtual machine.

Examples

Example 1: Enable boot diagnostics

$VM = Get-AzVM -ResourceGroupName "ResourceGroup11" -Name "ContosoVM07"
Set-AzVMBootDiagnostic -VM $VM -Enable -ResourceGroupName "ResourceGroup11" -StorageAccountName "DiagnosticStorage"
Update-AzVM -VM $VM -ResourceGroupName "ResourceGroup11"

The first command gets the virtual machine named ContosoVM07 by using Get-AzVM. The command stores it in the $VM variable. The second command enables boot diagnostics for the virtual machine in $VM. Diagnostics data is stored in the specified account.

Parameters

-DefaultProfile

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

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Disable

Indicates that this cmdlet disables the boot diagnostics for the virtual machine.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

DisableBootDiagnostics
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Enable

Indicates that this cmdlet enables the boot diagnostics for the virtual machine.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnableBootDiagnostics
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

Specifies the name of the resource group of storage account.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnableBootDiagnostics
Position:2
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-StorageAccountName

Specifies the name of the storage account in which to save boot diagnostics data. If not provided, it will look for a StorageUri in the BootDiagnostic Profile in the PSVirtualMachine object provided in the '-VM' parameter. If StorageUri is null, it will default to used a managed storage account.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

EnableBootDiagnostics
Position:3
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-VM

Specifies the virtual machine for which this cmdlet changes boot diagnostics. To obtain a virtual machine object, use the Get-AzVM cmdlet.

Parameter properties

Type:PSVirtualMachine
Default value:None
Supports wildcards:False
DontShow:False
Aliases:VMProfile

Parameter sets

(All)
Position:0
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

PSVirtualMachine

String

Outputs

PSVirtualMachine