Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
moiaune opened this issue May 25, 2021 · 2 comments · Fixed by #57
Closed

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

moiaune opened this issue May 25, 2021 · 2 comments · Fixed by #57
Assignees

Comments

@moiaune
Copy link
Contributor

moiaune commented May 25, 2021

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.

@PrateekKumarSingh PrateekKumarSingh added this to the Release AzViz v1.2 milestone Jun 26, 2021
@PrateekKumarSingh PrateekKumarSingh self-assigned this Jun 26, 2021
@PrateekKumarSingh
Copy link
Owner

@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.

@PrateekKumarSingh
Copy link
Owner

PrateekKumarSingh commented Jun 27, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants