Azure / PSRule.Rules.Azure

Rules to validate Azure resources and infrastructure as code (IaC) using PSRule.
https://azure.github.io/PSRule.Rules.Azure/
MIT License
383 stars 84 forks source link

[BUG] Export-AzRuleData overwrites export file when exporting a large subscription #2957

Closed flamableassassin closed 1 month ago

flamableassassin commented 1 month ago

Existing rule

No response

Description of the issue

When using Export-AzRuleData with the scope of a subscription with a lot of resources (over 3k in my case), it will try to create 2 files. The files have the same name just different case which means the second file overwrites the first file in windows resulting in 1 file rather than 2.

Please see https://github.com/Azure/PSRule.Rules.Azure/issues/34#issuecomment-1963596458 as well

Error messages

Mode LastWriteTime Length Name


-a--- 28/06/2024 10:27 32983629  x11111i8-fx1x-1111-a1x1-1a11x11fTa11.json -a--- 28/06/2024 10:27 20923  X11111i8-FX1X-1111-A1X1-1A11X11FTA11.json

Reproduction

Run Export-AzRuleData on the scope of a subscription with a lot of resources (i had over 3k)

Version of PSRule

2.9.0

Version of PSRule for Azure

No response

Additional context

No response