You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Checks the battery full charge capacity VS the design capacity
4
+
.DESCRIPTION
5
+
This was written specifically for use as a "Script Check" in mind, where it the output is deliberaly light unless a warning or error condition is found that needs more investigation.
6
+
7
+
If the total full charge capacity is less than the minimum capacity amount, an error is returned.
8
+
#>
9
+
10
+
[CmdletBinding()]
11
+
param(
12
+
[Parameter(Mandatory=$false)]
13
+
[int]#The minimum battery full charge capacity (as a percentage of design capacity by default). Defaults to 85 percent.
14
+
$minimumBatteryCapacity=85,
15
+
16
+
[Parameter(Mandatory=$false)]
17
+
[switch]#Set the check condition to absolute mWh values instead of a percentage
18
+
$absoluteValues
19
+
)
20
+
21
+
try{
22
+
$searcher=New-Object System.Management.ManagementObjectSearcher("root\wmi","SELECT * FROM BatteryStaticData")
23
+
$batteryStatic=$searcher.Get()
24
+
#CIM approach threw errors when Get-WMIObject did not - WMI approach is not available in PSv7, so took .NET approach
Write-Output"The battery needs investigating. Full charge capacity is below the threshold of $minimumBatteryCapacity$label ($available$label available of design capacity $designCapacity mWh."
49
+
Exit1
50
+
} else {
51
+
Write-Output"The battery is reporting ok. Full charge capacity is above the threshold of $minimumBatteryCapacity$label ($available$label available of design capacity $designCapacity mWh."
This was written specifically for use as a "Script Check" in mind, where it the output is deliberaly light unless a warning or error condition is found that needs more investigation.
6
+
7
+
If the totalhours of uptime of the computer is greater than or equal to the warning limit, an error is returned.
8
+
#>
9
+
10
+
[cmdletbinding()]
11
+
Param(
12
+
[Parameter(Mandatory=$false)]
13
+
[int]#Warn if the uptime total hours is over this limit. Defaults to 2.5 days.
This was written specifically for use as a "Script Check" in mind, where it the output is deliberaly light unless a warning or error condition is found that needs more investigation.
6
+
7
+
Uses the Windows Storage Reliabilty Counters first (the information behind Settings - Storage - Disks & Volumes - %DiskID% - Drive health) to report on drive health.
8
+
9
+
Will exit if running on a virtual machine.
10
+
11
+
.NOTES
12
+
Learing taken from "Win_Disk_SMART2.ps1" by nullzilla, and modified by: redanthrax
13
+
#>
14
+
15
+
# Requires -Version 5.0
16
+
# Requires -RunAsAdministrator
17
+
[cmdletbinding()]
18
+
Param(
19
+
[Parameter(Mandatory=$false)]
20
+
[int]#Warn if the temperature (in degrees C) is over this limit
21
+
$TemperatureWarningLimit=55,
22
+
23
+
[Parameter(Mandatory=$false)]
24
+
[int]#Warn if the "wear" of the drive (as a percentage) is above this
25
+
$maximumWearAllowance=20,
26
+
27
+
[Parameter(Mandatory=$false)]
28
+
[switch]#Outputs a full report, instead of warnings only
29
+
$fullReport
30
+
)
31
+
32
+
BEGIN {
33
+
# If this is a virtual machine, we don't need to continue
0 commit comments