Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions 7-Report/Get-Report.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ $xlsxFileName = "Availability_Report_$timestamp.xlsx"

If ($availabilityInfoPath) {
# Consider splitting into functions for better readability and maintainability
$reportData = @()

foreach ($path in $availabilityInfoPath) {
$reportData = @()
$rawdata = Get-Content $path | ConvertFrom-Json -Depth 10
foreach ($item in $rawdata) {
$resourceType = $item.ResourceType
Expand All @@ -142,7 +143,6 @@ If ($availabilityInfoPath) {
If ($item.SelectedRegion.available -eq "true") {
$regionAvailability = "Available"
}

# if implementedSkus is exists and is not null
if ($item.ImplementedSkus -and $item.ImplementedSkus[0] -ne "N/A") {
if ( $regionAvailability -eq "Available") {
Expand All @@ -167,13 +167,13 @@ If ($availabilityInfoPath) {
$reportData += $reportItem
}
}
$WorksheetName = "SvcAvail_$($regionHeader)"
$allProps = Get-Props -data $reportData
$lastColumnNumber = $allProps.Count
New-Worksheet -WorksheetName $WorksheetName -LastColumnNumber $lastColumnNumber -reportData $reportData -startColumnNumber 5 -cellValGreen @("Available", "N/A") -cellValRed @("Not available") -cellValYellow @("NotCoveredByScript")
}
}

$WorksheetName = "ServiceAvailability"
$allProps = Get-Props -data $reportData
$lastColumnNumber = $allProps.Count
New-Worksheet -WorksheetName $WorksheetName -LastColumnNumber $lastColumnNumber -reportData $reportData -startColumnNumber 5 -cellValGreen @("Available", "N/A") -cellValRed @("Not available") -cellValYellow @("NotCoveredByScript")

If ($costComparisonPath) {
$rawdata = Get-Content $costComparisonPath | ConvertFrom-Json -Depth 10
Expand Down
9 changes: 5 additions & 4 deletions docs/wiki/7-Report.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# 7-Report

This script generates formatted Excel (`.xlsx`)reports based on the output from the previous check script. The reports provide detailed information for each service, including:
This script generates formatted Excel (`.xlsx`) reports based on the output from the previous check script. The reports provide detailed information for each service, including:

### Service Availability Report
## Service Availability Report

- **Resource type**
- **Resource count**
Expand Down Expand Up @@ -32,7 +32,8 @@ These reports help you analyze service compatibility and cost differences across
If you have created one or more availability JSON files using the `2-AvailabilityCheck/Get-Region.ps1` script, run the following commands, replacing the path with your actual file path(s):

```powershell
.\Get-Report.ps1 -availabilityInfoPath `@("..\2-AvailabilityCheck\Availability_Mapping_Asia_Pacific.json", "..\2-AvailabilityCheck\Availability_Mapping_Europe.json")` -costComparisonPath "..\3-CostInformation\region_comparison_prices.json"
.\Get-Report.ps1 -availabilityInfoPath `@("..\2-AvailabilityCheck\Availability_Mapping_southeastasia.json", "..\2-AvailabilityCheck\Availability_Mapping_westeurope.json")` -costComparisonPath "..\3-CostInformation\region_comparison_prices.json"

```
The script generates an `.xlsx` and `.csv` files in the `7-report` folder, named `Availability_Report_CURRENTTIMESTAMP`.

The script generates an `.xlsx` file in the `7-report` folder, named `Availability_Report_CURRENTTIMESTAMP`.