Functions/Compare-PasmAlgorithms.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<#
    2016// Øyvind Kallstad (@okallstad)
#>

function Compare-PasmAlgorithms {
    [CmdletBinding()]
    param (
        [Parameter(Position = 0, Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string] $String1,

        [Parameter(Position = 1, Mandatory)]
        [ValidateNotNullOrEmpty()]
        [string] $String2,

        [Parameter()]
        [switch] $CaseSensitive
    )

    foreach ($a in ([enum]::GetNames('PasmAlgorithm'))) {
        $pasmScore = 0
        $pasmScore = Get-PasmScore -String1 $String1 -String2 $String2 -CaseSensitive:$CaseSensitive -Algorithm $a
        Write-Output (,([PSCustomObject] [Ordered] @{
            String1 = $String1
            String2 = $String2
            Algorithm = $a
            Score = $pasmScore
        }))
    }
}