PrateekKumarSingh / AzViz

⚡ ☁ Azure Visualizer aka 'AzViz' : A #powershell module to automatically generate Azure resource topology diagrams by just typing a PowerShell cmdlet and passing the name of one or more Azure Resource groups

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Skips rest of $Targets if a resource group does not contain any resources

moiaune opened this issue · comments

commented

I think I found a bug in ConvertFrom-ARM.ps1.

On line 83 it will break out of the foreach loop if a resource group does not contain any resources, which means that I will skip rest of whats in $Targets.

Example:

Let's say you have 4 resource groups.

  • my-rg-1 (contains resources)
  • my-rg-2 (is empty)
  • my-rg-3 (contains resources)
  • my-rg-4 (contains resource)

According to the script it will not check my-rg-3 and my-rg-4, since my-rg-2 is empty.

I think this should be a continue statement instead.

@madsaune That is a very good catch, and was a total miss from my end! Thanks for creating the issue, I'm fixing this in next commit.