Public/DotNet/Test-Symbol.ps1

function Test-Symbol {
    [CmdletBinding()]
    [CmdLetTag(("#dotnet","#dotnetcore"))]
    param (
        [parameter(Mandatory, ValueFromPipeline)]
        [System.IO.FileInfo]$pdb,
        [parameter()]
        [string]$file,
        [parameter()]
        [ValidateSet("Check", "Match")]
        [string]$Mode = "Check",
        [parameter()]
        [string]$chckMatch = "$PSScriptRoot\..\..\Private\ChkMatch.exe"
    )
    
    begin {
        if (!(test-path $chckMatch)) {
            throw "$chckMatch is invalid"
        }
        $pdbFile = (get-item $pdb)
        if (!$File) {
            $file = "$($pdbFile.DirectoryName)\$($pdbFile.BaseName).dll"
        }
        if (!(Test-Path $file)) {
            throw [System.IO.FileNotFoundException]::new($file)
        }
    }
    
    process {
        if ($Mode -eq "Check") {
            & $chckMatch -c $file $pdbFile.FullName
        }
        else {
            & $chckMatch -m $file $pdbFile.FullName
        }
    }
    
    end {
    }
}