# BASHINTOSH 2017
# IOBIOS v0.1

# Set-PSdebug -trace 2

$location = Split-Path $MyInvocation.MyCommand.path -parent
pushd $location

$exec = ".\afuwin.exe"
$getlcd = Get-CimInstance -Namespace root\wmi -Classname WmiMonitorBasicDisplayParams | Select -exp InstanceName
$lcdtrim = $getlcd.split('\')[1]

if ($lcdtrim -like 'MS_9001') {
   &$exec WEI21N114_R6.bin /p /b /r /x /l /n /reboot
   }
   elseif ($lcdtrim -like 'MS_9003') {
   &$exec WEI21N114_R9.bin /p /b /r /x /l /n /reboot
   }
   else {
   break
   }