Skips rest of $Targets if a resource group does not contain any resources
moiaune opened this issue · comments
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.
Added continue
statement to the logic:
https://github.com/PrateekKumarSingh/AzViz/blob/master/AzViz/src/private/ConvertFrom-ARM.ps1#L83