Skip to content

Commit

Permalink
Added Licensing Information to AAD report
Browse files Browse the repository at this point in the history
  • Loading branch information
dagarwal-mitre committed Feb 28, 2024
1 parent 846d65e commit 1f53cf3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
18 changes: 16 additions & 2 deletions PowerShell/ScubaGear/Modules/CreateReport/CreateReport.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -182,12 +182,26 @@ function New-Report {
# Handle AAD-specific reporting
if ($BaselineName -eq "aad") {
$ReportHTML = $ReportHTML.Replace("{AADWARNING}", $AADWarning)
$ReportHTML = $ReportHTML.Replace("{CAPTABLES}", "")

# Create an array of custom objects for each SKU
$LicenseInfoArray = $SettingsExport.license_information | ForEach-Object {
[pscustomobject]@{
"SKU Part Number" = $_.SkuPartNumber
"Used Licenses" = $_.ConsumedUnits
"Total Licenses" = $_.PrepaidUnits.Enabled
}
}
# Convert the custom objects to an HTML table
$LicenseTable = $LicenseInfoArray | ConvertTo-Html -As Table -Fragment

# Create a section header for the licensing information
$LicensingHTML = "<h2>Licensing Information</h2>" + $LicenseTable
$ReportHTML = $ReportHTML.Replace("{LICENSING_INFO}", $LicensingHTML)
$CapJson = ConvertTo-Json $SettingsExport.cap_table_data
}
else {
$ReportHTML = $ReportHTML.Replace("{AADWARNING}", $NoWarning)
$ReportHTML = $ReportHTML.Replace("{CAPTABLES}", "")
$ReportHTML = $ReportHTML.Replace("{LICENSING_INFO}", "")
$CapJson = "null"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<h1>{TITLE}</h1>
<h4>{AADWARNING}</h4>
{TABLES}
{LICENSING_INFO}
</main>
</body>
</html>

0 comments on commit 1f53cf3

Please sign in to comment.