|
| 1 | +# Microsoft AD Default Document Style |
| 2 | + |
| 3 | +# Configure document options |
| 4 | +DocumentOption -EnableSectionNumbering -PageSize A4 -DefaultFont 'Arial' -MarginLeftAndRight 71 -MarginTopAndBottom 71 -Orientation $Orientation |
| 5 | + |
| 6 | +# Configure Heading and Font Styles |
| 7 | +Style -Name 'Title' -Size 24 -Color '737373' -Align Center |
| 8 | +Style -Name 'Title 2' -Size 18 -Color '00A4EF' -Align Center |
| 9 | +Style -Name 'Title 3' -Size 12 -Color '00A4EF' -Align Left |
| 10 | +Style -Name 'Heading 1' -Size 16 -Color '00A4EF' |
| 11 | +Style -Name 'Heading 2' -Size 14 -Color '00A4EF' |
| 12 | +Style -Name 'Heading 3' -Size 12 -Color '00A4EF' |
| 13 | +Style -Name 'Heading 4' -Size 11 -Color '00A4EF' |
| 14 | +Style -Name 'Heading 5' -Size 10 -Color '00A4EF' |
| 15 | +Style -Name 'Normal' -Size 10 -Color '565656' -Default |
| 16 | +Style -Name 'Caption' -Size 10 -Color '565656' -Italic -Align Center |
| 17 | +Style -Name 'Header' -Size 10 -Color '565656' -Align Center |
| 18 | +Style -Name 'Footer' -Size 10 -Color '565656' -Align Center |
| 19 | +Style -Name 'TOC' -Size 16 -Color '00A4EF' |
| 20 | +Style -Name 'TableDefaultHeading' -Size 10 -Color 'FAFAFA' -BackgroundColor '00A4EF' |
| 21 | +Style -Name 'TableDefaultRow' -Size 10 -Color '565656' |
| 22 | +Style -Name 'Critical' -Size 10 -BackgroundColor 'F25022' |
| 23 | +Style -Name 'Warning' -Size 10 -BackgroundColor 'FFB900' |
| 24 | +Style -Name 'Info' -Size 10 -BackgroundColor '00A4EF' |
| 25 | +Style -Name 'OK' -Size 10 -BackgroundColor '7FBA00' |
| 26 | + |
| 27 | +# Configure Table Styles |
| 28 | +$TableDefaultProperties = @{ |
| 29 | + Id = 'TableDefault' |
| 30 | + HeaderStyle = 'TableDefaultHeading' |
| 31 | + RowStyle = 'TableDefaultRow' |
| 32 | + BorderColor = '00A4EF' |
| 33 | + Align = 'Left' |
| 34 | + CaptionStyle = 'Caption' |
| 35 | + CaptionLocation = 'Below' |
| 36 | + BorderWidth = 0.25 |
| 37 | + PaddingTop = 1 |
| 38 | + PaddingBottom = 1.5 |
| 39 | + PaddingLeft = 2 |
| 40 | + PaddingRight = 2 |
| 41 | +} |
| 42 | + |
| 43 | +TableStyle @TableDefaultProperties -Default |
| 44 | +TableStyle -Id 'Borderless' -HeaderStyle Normal -RowStyle Normal -BorderWidth 0 |
| 45 | + |
| 46 | +# Microsoft AD Cover Page Layout |
| 47 | +# Header & Footer |
| 48 | +if ($ReportConfig.Report.ShowHeaderFooter) { |
| 49 | + Header -Default { |
| 50 | + Paragraph -Style Header "$($ReportConfig.Report.Name) - v$($ReportConfig.Report.Version)" |
| 51 | + } |
| 52 | + |
| 53 | + Footer -Default { |
| 54 | + Paragraph -Style Footer 'Page <!# PageNumber #!>' |
| 55 | + } |
| 56 | +} |
| 57 | + |
| 58 | +# Set position of report titles and information based on page orientation |
| 59 | +if (!($ReportConfig.Report.ShowCoverPageImage)) { |
| 60 | + $LineCount = 5 |
| 61 | +} |
| 62 | +if ($Orientation -eq 'Portrait') { |
| 63 | + BlankLine -Count 11 |
| 64 | + $LineCount = 32 + $LineCount |
| 65 | +} else { |
| 66 | + BlankLine -Count 7 |
| 67 | + $LineCount = 15 + $LineCount |
| 68 | +} |
| 69 | + |
| 70 | +# Microsoft Logo Image |
| 71 | +if ($ReportConfig.Report.ShowCoverPageImage) { |
| 72 | + # Always check the vendor's branding guidelines to ensure the use of their company logo is allowed. |
| 73 | + # Convert a vendor's logo image to Base64 using https://base64.guru/converter/encode/image/jpg. |
| 74 | + # Specify Base64 code using the `Base64` parameter below. Size image accordingly using the `Percent` parameter. Align image to center. |
| 75 | + <# |
| 76 | + Try { |
| 77 | + # Image -Text 'Microsoft Logo' -Align 'Center' -Percent 5 -Base64 "" |
| 78 | + } Catch { |
| 79 | + Write-PScriboMessage -Message ".NET Core is required for cover page image support. Please install .NET Core or disable 'ShowCoverPageImage' in the report JSON configuration file." |
| 80 | + } |
| 81 | + #> |
| 82 | +} |
| 83 | + |
| 84 | +# Add Report Name |
| 85 | +Paragraph -Style Title $ReportConfig.Report.Name |
| 86 | + |
| 87 | +if ($AsBuiltConfig.Company.FullName) { |
| 88 | + # Add Company Name if specified |
| 89 | + BlankLine -Count 2 |
| 90 | + Paragraph -Style Title2 $AsBuiltConfig.Company.FullName |
| 91 | + BlankLine -Count $LineCount |
| 92 | +} else { |
| 93 | + BlankLine -Count ($LineCount + 1) |
| 94 | +} |
| 95 | +Table -Name 'Cover Page' -List -Style Borderless -Width 0 -Hashtable ([Ordered] @{ |
| 96 | + 'Author:' = $AsBuiltConfig.Report.Author |
| 97 | + 'Date:' = (Get-Date).ToLongDateString() |
| 98 | + 'Version:' = $ReportConfig.Report.Version |
| 99 | + }) |
| 100 | +PageBreak |
| 101 | + |
| 102 | +if ($ReportConfig.Report.ShowTableOfContents) { |
| 103 | + # Add Table of Contents |
| 104 | + TOC -Name 'Table of Contents' |
| 105 | + PageBreak |
| 106 | +} |
0 commit comments