ScubaGear
ScubaGear copied to clipboard
Fix error when tenant has no licenses
🗣 Description
Running on a new tenant with no licenses in use Get-MgBetaSubscribedSku will return with a body of [].
💭 Motivation and context
$LicenseInfo was not verifying $SubscribedSku had data before creating the variable that will be used in the report, resulting in a JSON primitive error because the JSON is "license_information": ,
🧪 Testing
✅ Pre-approval checklist
- [ ] This PR has an informative and human-readable title.
- [ ] PR targets the correct parent branch (e.g., main or release-name) for merge.
- [ ] Changes are limited to a single goal - eschew scope creep!
- [ ] Changes are sized such that they do not touch excessive number of files.
- [ ] All future TODOs are captured in issues, which are referenced in code comments.
- [ ] These code changes follow the ScubaGear content style guide.
- [ ] Related issues these changes resolve are linked preferably via closing keywords.
- [ ] All relevant type-of-change labels added.
- [ ] All relevant project fields are set.
- [ ] All relevant repo and/or project documentation updated to reflect these changes.
- [ ] Unit tests added/updated to cover PowerShell and Rego changes.
- [ ] Functional tests added/updated to cover PowerShell and Rego changes.
- [ ] All relevant functional tests passed.
- [ ] All automated checks (e.g., linting, static analysis, unit/smoke tests) passed.
✅ Pre-merge checklist
-
[ ] PR passed smoke test check.
-
[ ] Feature branch has been rebased against changes from parent branch, as needed
Use
Rebase branch
button below or use this reference to rebase from the command line. -
[ ] Resolved all merge conflicts on branch
-
[ ] Notified merge coordinator that PR is ready for merge via comment mention
✅ Post-merge checklist
- [ ] Feature branch deleted after merge to clean up repository.
- [ ] Verified that all checks pass on parent branch (e.g., main or release-name) after merge.