jamesstringerparsec/Easy-GPU-PV

PreChecks.ps1 returns empty when my Computer(Desktop PC) connected to an UPS

stephsix opened this issue · 0 comments

In the Function Get-DesktopPC of PreChecks.ps1:

Function Get-DesktopPC
{
 $isDesktop = $true
 if(Get-WmiObject -Class win32_systemenclosure | Where-Object { $_.chassistypes -eq 9 -or $_.chassistypes -eq 10 -or $_.chassistypes -eq 14})
   {
   Write-Warning "Computer is a laptop. Laptop dedicated GPU's that are partitioned and assigned to VM may not work with Parsec." 
   Write-Warning "Thunderbolt 3 or 4 dock based GPU's may work"
   $isDesktop = $false }
 if (Get-WmiObject -Class win32_battery)
   { $isDesktop = $false }
 $isDesktop
}

it returns false when it detects a win32_battery in WmiObject. However, my computer incorrectly matches this condition when connected to an UPS.