Advertisement
Guest User

Untitled

a guest
Nov 5th, 2019
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #region Video сontrollers
  2. # Integrated graphics
  3. IF ((Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -eq "Internal"}))
  4. {
  5.     $Caption = @{
  6.         Name = "Model"
  7.         Expression = {$_.Caption}
  8.     }
  9.     $VRAM = @{
  10.         Name = "VRAM, GB"
  11.         Expression = {[math]::round($_.AdapterRAM/1GB)}
  12.     }
  13.     Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -eq "Internal"} | Select-Object -Property $Caption, $VRAM
  14. }
  15. # Dedicated graphics
  16. IF ((Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal"}))
  17. {
  18.     $qwMemorySize = (Get-ItemProperty -Path "HKLM:\SYSTEM\ControlSet001\Control\Class\{4d36e968-e325-11ce-bfc1-08002be10318}\0*" -Name HardwareInformation.qwMemorySize -ErrorAction SilentlyContinue)."HardwareInformation.qwMemorySize"
  19.     $VRAM = [math]::round($qwMemorySize/1GB)
  20.     Get-CimInstance -ClassName CIM_VideoController | Where-Object -FilterScript {$_.AdapterDACType -ne "Internal"} | ForEach-Object -Process {
  21.         [PSCustomObject] @{
  22.             Model = $_.Caption
  23.             "VRAM, GB" = $VRAM
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement