PoshCode Archive  Artifact [a00434646f]

Artifact a00434646febc9ff944a2a598a435bc6491df64efe547ab32f6f1553cb40b835:

  • File Get-WindowsExperience.ps1 — part of check-in [321907318e] at 2018-06-10 13:17:44 on branch trunk — Get the Windows Experience Rating (user: Joel Bennett size: 1069)

# encoding: ascii
# api: powershell
# title: Get-WindowsExperience
# description: Get the Windows Experience Rating
# version: 0.1
# type: function
# author: Joel Bennett
# license: CC0
# function: Get-WindowsExperienceRating
# x-poshcode-id: 2961
# x-derived-from-id: 2962
# x-archived: 2011-11-05T17:18:18
# x-published: 2011-09-21T09:52:00
#
#
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 {
  Get-WmiObject -ComputerName $ComputerName Win32_WinSAT | ForEach-Object {
     if($_.WinSatAssessmentState -ne 1) {
        Write-Warning "WinSAT data for '$($_.__SERVER)' is out of date ($($_.WinSatAssessmentState))"
     }
     $_
  } | Select-Object -Property @{name="Computer";expression={$_.__SERVER}}, *Score #, WinSPRLevel
}
}