# Comparing 03

Comparing 03 on Evotec with practical examples, usage guidance, and reusable project workflows.

Project

PSWriteHTML

Generate HTML reports, dashboards, and emails from PowerShell without writing HTML, CSS, or JavaScript.

[View on GitHub](https://github.com/EvotecIT/PSWriteHTML) [Visit Website](#) [Releases](https://github.com/EvotecIT/PSWriteHTML/releases/tag/v1.41.0) [Changelog](#) [Get package](https://www.powershellgallery.com/packages/PSWriteHTML)

Stars**1025**

Forks**115**

Open issues**0**

PowerShell Gallery downloads**7576901**

Release**v1.45.0**

Language: PowerShell Updated: 2026-11-19

Curated Examples

An example script from the PSWriteHTML repository.

- Source repository: [https://github.com/EvotecIT/PSWriteHTML](https://github.com/EvotecIT/PSWriteHTML)
- Example group: `Example-Comparing`

```powershell
Import-Module .\PSWriteHTML.psd1 -Force

Get-ADComputer -SearchBase 'OU=Domain Controllers,DC=ad,DC=evotec,DC=xyz' -Filter * -Properties * | Select-Object -First 5 | Out-HtmlView -Compare -HighlightDifferences {
    New-HTMLTableReplace -Replacements 'AD2', 'AD1'
    New-HTMLTableReplace -Replacements 'AD3', 'AD1'
    New-HTMLTableReplace -Replacements 'AD4', 'AD1'
    New-HTMLTableCondition -Name 'Name' -Value 'ServicePrincipalName' -BackgroundColor Gold -Row
    New-HTMLTableCondition -Name 'Name' -Value 'CanonicalName' -BackgroundColor Gold -Row
    New-HTMLTableCondition -Name 'Name' -Value 'accountExpires' -BackgroundColor Gold -Row
    New-HTMLTableCondition -Name 'Status' -ComparisonType string -Operator eq -Value $false -BackgroundColor Red -Color White
    New-HTMLTableCondition -Name 'Status' -ComparisonType string -Operator eq -Value $true -BackgroundColor Green -Color White
}

Get-ADComputer -SearchBase 'OU=Domain Controllers,DC=ad,DC=evotec,DC=xyz' -Filter * -Properties * | Select-Object -First 5 | Out-HtmlView -Compare -HighlightDifferences


$Objects2 = @(
    Get-ADComputer -SearchBase 'OU=Domain Controllers,DC=ad,DC=evotec,DC=xyz' -Filter * -Properties *
)

$Objects3 = @(
    [ordered] @{ Test = 'My value 1'; Test1 = 'My value1' }
    [ordered] @{ Test = 'My value 2'; Test1 = 'My value1' }
    #  @{ Test = 'My value 3'; Test1 = 'My value1' }
    #  @{ Test = 'My value 3'; Test2 = 'My value1', 'my value 3' }
)

$Replace = @(
    @{ 'DNSHostName' = 'AD2', 'AD1' }
    @{ 'DNSHostName' = 'AD3', 'AD1' }
    #@{ '' = 'AD2', 'AD1' }
    #@{ '' = 'AD3', 'AD1' }
)

#Compare-MultipleObjects -Objects $Objects2 -FormatOutput -Summary -Replace $Replace -ExcludeProperty SID | ft -AutoSize


New-HTML -TitleText $Title -Online -FilePath $PSScriptRoot\Example-Comparing03.html {
    New-HTMLSection -HeaderText 'Comparing Object with Highlighting Differences (Domain Controllers)' {
        New-HTMLTable -DataTable $Objects2 -Compare -AllProperties -HighlightDifferences {
            New-HTMLTableReplace -Replacements 'AD2', 'AD1'
            New-HTMLTableReplace -Replacements 'AD3', 'AD1'
        }
    }
    New-HTMLSection -HeaderText 'Comparing Object with Highlighting Differences (Hashtables)' {
        New-HTMLTable -DataTable $Objects3 -Compare -AllProperties -HighlightDifferences #-Replace $Replace
    }
} -ShowHTML
```

<!-- PowerForge markdown artifact sha256:FC7DA60DCE1E5881B4515D148A74985E3F17C7087548DECDDFAF199BE1A17BA1 -->
