https://docs.microsoft.com/en-us/azure/virtual-machines/extensions/oms-windows
PowerShell deployment
The Set-AzVMExtension
command can be used to deploy the Log Analytics agent virtual machine extension to an existing virtual machine. Before running the command, the public and private configurations need to be stored in a PowerShell hash table.
PowerShell
$PublicSettings = @{"workspaceId" = "myWorkspaceId"}
$Prot