title: Display Inventory in Powershell (Help)
body: <p>I'm working in a script to generate a report of the inventory in my work.
  Most part of the script is working fine, but I'm having problems to get monitor size in inches correctly.</p>
  
  <p>How can I get these values in my current script?</p>
  
  <pre><code>$ManufacturerHash = @{
  "AAC" = "AcerView";
  "ACR" = "Acer";
  "ACI" = " Asus";
  "APP" = "Apple Computer";
  "AUO" = "Asus";
  "CMO" = "Acer";
  "CPQ" = "Compaq";
  "DEL" = "Dell";
  "HWP" = "HP";
  "LEN" = "Lenovo";
  "SAN" = "Samsung";
  "SAM" = "Samsung";
  "SNY" = "Sony";
  "SRC" = "Shamrock";
  "SUN" = "Sun Microsystems";
  "SEC" = "Hewlett-Packard";
  "TAT" = "Tatung";
  "TOS" = "Toshiba";
  "TSB" = "Toshiba";
  "VSC" = "ViewSonic";
  "UNK" = "Unknown";
  "_YV" = "Fujitsu";
  }
  
  Write-Host "##Monitors##"  -ForegroundColor Green
  $displayDevices = Get-WmiObject -Namespace root\WMI -Class WMIMonitorID
  $DisplayParams = Get-WmiObject -Namespace root\WMI -Class WmiMonitorBasicDisplayParams
  
  foreach ($displayDevice in $displayDevices) {
          If ([System.Text.Encoding]::ASCII.GetString($displayDevice.UserFriendlyName) -ne $null) {
              $displayModel = ([System.Text.Encoding]::ASCII.GetString($displayDevice.UserFriendlyName)).Replace("$([char]0x0000)","")
          } else {
              $displayModel = $null
          }
  
      $displaySerial = ([System.Text.Encoding]::ASCII.GetString($displayDevice.SerialNumberID)).Replace("$([char]0x0000)","")
      $displayManufacturer = ([System.Text.Encoding]::ASCII.GetString($displayDevice.ManufacturerName)).Replace("$([char]0x0000)","")
  
      $displayManufacturerFriendly = $ManufacturerHash.$displayManufacturer 
  
          If ($displayManufacturerFriendly -eq $null) {
              $displayManufacturerFriendly = $displayManufacturer
          }
  
     $MaxHorizontalImageSize = [System.Math]::Pow($monitor.MaxHorizontalImageSize, 2)
     $MaxVerticalImageSize = [System.Math]::Pow($monitor.MaxVerticalImageSize, 2)
     $inches= [System.Math]::Round(([System.Math]::Sqrt($MaxHorizontalImageSize + $MaxVerticalImageSize)/2.54))
  
     Write-Host "Manufacturer:"$displayManufacturerFriendly 
     Write-Host "Model:"$displayModel
     Write-Host "Serial:"$displaySerial
     Write-Host "Size: $inches inches"
     Write-Host ""
  </code></pre>