PoshCode Archive  Artifact [2795b09280]

Artifact 2795b092807bd97973109e422a54482c4a204e92d0724ec07134c0f879a84ed8:

  • File Get-WindowsExperience.ps1 — part of check-in [6768fc45ba] at 2018-06-10 13:08:33 on branch trunk — Get the Windows Experience Rating (user: unknown size: 981)

# encoding: ascii
# api: powershell
# title: Get-WindowsExperience
# description: Get the Windows Experience Rating
# version: 0.1
# type: function
# license: CC0
# function: Get-WindowsExperienceRating
# x-poshcode-id: 2311
# x-archived: 2010-10-21T23:40:58
#
#
function Get-WindowsExperienceRating {
#.Synopsis
#  Gets the Windows Experience Ratings
#.Parameter ComputerName
#  The name(s) of the computer(s) to get the Windows Experience (WinSat) numbers for.
[CmdletBinding()]
param(
  [Parameter(ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
  [string[]]$ComputerName='localhost'
)
process {
  $winSat = Get-WmiObject -ComputerName $ComputerName Win32_WinSAT
  if($WinSat.WinSatAssessmentState -ne 1) {
     Write-Warning "WinSAT data for '$($winSat.__SERVER)' is out of date ($($winSat.WinSatAssessmentState))"
  }
  Select-Object -Input $winSat -Property @{name="Computer";expression={$_.__SERVER}}, *Score #, WinSPRLevel
}
}