Hi,
I am trying to do the following:
using find-AzureRmResources find all VM not located in westeurope. If all my resources are in weseurope then display "There is nothing outside westeurope"
$getvms=Find-AzureRmResource|where{$_.ResourceType -like"Microsoft.Compute/virtualMachines"-and$_.Location -notlike"Westeurope"}
Foreach ($eachvmin$getvms)
{
If (!$eachvm) {write-host'There is nothing outside westeurope'}
else {Write-Host"You have the following not in westeurope"$eachvm.Name}
}
however even when all my vm's are in westeurope, the script just end and goes back to the cursor without displaying anything.