I don't believe theres a CLI or PowerShell command to do that directory, however, this PowerShell script will look through all your Virtual Machines and export the extensions to a table:
# Connect to Azure
Connect-AzAccount
# Get all virtual machines
$vms = Get-AzVM
# Create an array to store the extension data
$extensionData = @()
# Loop through each virtual machine and get its extensions
foreach ($vm in $vms) {
$vmName = $vm.Name
$resourceGroup = $vm.ResourceGroupName
$extensions = Get-AzVMExtension -ResourceGroupName $resourceGroup -VMName $vmName
foreach ($extension in $extensions) {
$extensionData += [PSCustomObject]@{
VirtualMachine = $vmName
ExtensionName = $extension.Name
Publisher = $extension.Publisher
Version = $extension.Version
ProvisioningState = $extension.ProvisioningState
}
}
}
# Display the extension data in a table
$extensionData | Format-Table -AutoSize