diff --git a/7-Report/Get-Report.ps1 b/7-Report/Get-Report.ps1 index edacf63..c5f2aa5 100644 --- a/7-Report/Get-Report.ps1 +++ b/7-Report/Get-Report.ps1 @@ -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 @@ -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") { @@ -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 diff --git a/docs/wiki/7-Report.md b/docs/wiki/7-Report.md index 0d9e4eb..d3ce6f6 100644 --- a/docs/wiki/7-Report.md +++ b/docs/wiki/7-Report.md @@ -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** @@ -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`.