finnget.psm1

Function finnget()
{

    $OperatingSystem = Get-OS

    if ($OperatingSystem -match "Windows 10") {
        $AsciiArt = . Get-Windows10Art;
    } elseif ($OperatingSystem -match "Windows 11") {
        $AsciiArt = . Get-Windows11Art;
    } else {
        Write-Error "Unsupported operating system: $OperatingSystem";
        $AsciiArt = . Get-SkullArt;
        return;
    }

    $SystemInfoCollection = . Get-SystemSpecifications;
    $LineToTitleMappings = . Get-LineToTitleMappings;

    if ($SystemInfoCollection.Count -gt $AsciiArt.Count) 
    { 
        Write-Error "System Specs occupies more lines than the Ascii Art resource"
    }

    for ($line = 0; $line -lt $AsciiArt.Count; $line++) 
    {
        Write-Host $AsciiArt[$line] -f Blue -NoNewline;
        Write-Host $LineToTitleMappings[$line] -f Red -NoNewline;

        if ($line -eq 0) 
        {
            Write-Host $SystemInfoCollection[$line] -f Red;
        }

        elseif ($SystemInfoCollection[$line] -like '*:*') 
        {
            $Seperator = ":";
            $Splitted = $SystemInfoCollection[$line].Split($seperator);

            $Title = $Splitted[0] + $Seperator;
            $Content = $Splitted[1];

            Write-Host $Title -f Red -NoNewline;
            Write-Host $Content;
        }
        else 
        {
            Write-Host $SystemInfoCollection[$line];            
        }
    }
}