public/cost/Get-ArgCostHybridUseBenefitsNotEnabled.ps1

function Get-ArgCostHybridUseBenefitsNotEnabled {
    $query = @"
Resources
| where type =~ 'microsoft.compute/virtualMachines'
| extend imageOffer = tostring(properties.storageProfile.imageReference.offer),
         licenseType = tostring(properties.licenseType)
| where imageOffer =~ 'WindowsServer' and (isnull(licenseType) or licenseType == '' or licenseType != 'Windows_Server')
| project id, name, resourceGroup, location, subscriptionId, imageOffer, licenseType
| sort by name asc
"@

    Search-AzGraph -Query $query
}