From 4c63ff8bd2ad9271d0db72308cd5332c97bb801d Mon Sep 17 00:00:00 2001 From: Takeshi Katano Date: Thu, 15 Aug 2024 05:10:04 +0000 Subject: [PATCH 1/2] feat: Add fence for non-supported operating systems (#274) Co-authored-by: kpoineal <38540295+kpoineal@users.noreply.github.com> --- tools/2_wara_data_analyzer.ps1 | 6 ++++++ tools/3_wara_reports_generator.ps1 | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/tools/2_wara_data_analyzer.ps1 b/tools/2_wara_data_analyzer.ps1 index 64a31c7d9..2c404017d 100644 --- a/tools/2_wara_data_analyzer.ps1 +++ b/tools/2_wara_data_analyzer.ps1 @@ -21,6 +21,12 @@ Param( [Parameter(mandatory = $true)] [string] $JSONFile) +# Checking the operating system running this script. +if (-not $IsWindows) { + Write-Host 'This script only supports Windows operating systems currently. Please try to run with Windows operating systems.' + Exit +} + if ($Debugging.IsPresent) { $DebugPreference = 'Continue' } else { $DebugPreference = 'silentlycontinue' } $Script:FilterRecommendations = $true diff --git a/tools/3_wara_reports_generator.ps1 b/tools/3_wara_reports_generator.ps1 index bdf5a7a5f..9fb7d081f 100644 --- a/tools/3_wara_reports_generator.ps1 +++ b/tools/3_wara_reports_generator.ps1 @@ -12,6 +12,12 @@ Param( [string] $WordTemplateFile ) +# Checking the operating system running this script. +if (-not $IsWindows) { + Write-Host 'This script only supports Windows operating systems currently. Please try to run with Windows operating systems.' + Exit +} + if ($Heavy.IsPresent) { $Global:Heavy = $true } else { $Global:Heavy = $false } if ($Debugging.IsPresent) { $Global:CoreDebugging = $true } else { $Global:CoreDebugging = $false } From f7673453ad1179e645a08a858d1cfec3a7a2a9c3 Mon Sep 17 00:00:00 2001 From: Takeshi Katano Date: Thu, 15 Aug 2024 05:12:56 +0000 Subject: [PATCH 2/2] feat: Improve recommendation sheet cell formats (#268) --- tools/2_wara_data_analyzer.ps1 | 50 ++++++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 12 deletions(-) diff --git a/tools/2_wara_data_analyzer.ps1 b/tools/2_wara_data_analyzer.ps1 index 2c404017d..656d81468 100644 --- a/tools/2_wara_data_analyzer.ps1 +++ b/tools/2_wara_data_analyzer.ps1 @@ -729,19 +729,45 @@ $Script:Runtime = Measure-Command -Expression { $Script:Recommendations += $tmp } + $columnCommonStyle = @{ + FontName = 'Calibri' + FontSize = 11 + WrapText = $true + } + + $headerCommonStyle = @{ + FontName = 'Calibri' + FontSize = 11 + FontColor = 'White' + Bold = $true + BackgroundColor = 'DarkSlateGray' + HorizontalAlignment = 'Center' + VerticalAlignment = 'Center' + WrapText = $true + } + $Styles2 = @( - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 14 -Range 'A1:B1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 18 -Range 'C1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 20 -Range 'D1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 35 -Range 'E1:F1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 20 -Range 'G1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 55 -Range 'H1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 10 -Range 'I1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 90 -Range 'J1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 45 -Range 'K1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 35 -Range 'L1:M1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -FontColor 'White' -VerticalAlignment Center -Bold -WrapText -BackgroundColor 'DarkSlateGray' -Width 45 -Range 'N1' - New-ExcelStyle -HorizontalAlignment Center -FontName 'Calibri' -FontSize 11 -VerticalAlignment Center -WrapText -Range 'A:N' + # Apply the style to the columns. + New-ExcelStyle @columnCommonStyle -Range 'A:G' -HorizontalAlignment Center -VerticalAlignment Center + New-ExcelStyle @columnCommonStyle -Range 'H:H' -HorizontalAlignment Left -VerticalAlignment Center + New-ExcelStyle @columnCommonStyle -Range 'I:I' -HorizontalAlignment Center -VerticalAlignment Center + New-ExcelStyle @columnCommonStyle -Range 'J:K' -HorizontalAlignment Left -VerticalAlignment Top + New-ExcelStyle @columnCommonStyle -Range 'L:L' -HorizontalAlignment Center -VerticalAlignment Center + New-ExcelStyle @columnCommonStyle -Range 'M:M' -HorizontalAlignment Left -VerticalAlignment Top + New-ExcelStyle @columnCommonStyle -Range 'N:N' -HorizontalAlignment Center -VerticalAlignment Center + + # Apply the style to the header row. + New-ExcelStyle @headerCommonStyle -Range 'A1:B1' -Width 14 + New-ExcelStyle @headerCommonStyle -Range 'C1' -Width 18 + New-ExcelStyle @headerCommonStyle -Range 'D1' -Width 20 + New-ExcelStyle @headerCommonStyle -Range 'E1:F1' -Width 35 + New-ExcelStyle @headerCommonStyle -Range 'G1' -Width 20 + New-ExcelStyle @headerCommonStyle -Range 'H1' -Width 55 + New-ExcelStyle @headerCommonStyle -Range 'I1' -Width 10 + New-ExcelStyle @headerCommonStyle -Range 'J1' -Width 90 + New-ExcelStyle @headerCommonStyle -Range 'K1' -Width 45 + New-ExcelStyle @headerCommonStyle -Range 'L1:M1' -Width 35 + New-ExcelStyle @headerCommonStyle -Range 'N1' -Width 45 ) # Configure the array of fields to be used in the Recommendations sheet