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.
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.
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.
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.