Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Set-AzVMBootDiagnostic
- Module:
- Az.Compute Module
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
-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
-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
-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
-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
-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
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
Related Links
Azure PowerShell
Feedback
Was this page helpful?
