| Availability# | uint16 | read | Availability and status of the device. Values (21)| Value | Label | Description |
|---|
| 1 | Other | | | 2 | Unknown | | | 3 | Running/Full Power | | | 4 | Warning | | | 5 | In Test | | | 6 | Not Applicable | | | 7 | Power Off | | | 8 | Off Line | | | 9 | Off Duty | | | 10 | Degraded | | | 11 | Not Installed | | | 12 | Install Error | | | 13 | Power Save - Unknown | The device is known to be in a power save mode, but its exact status is unknown. | | 14 | Power Save - Low Power Mode | The device is in a power save state but still functioning, and may exhibit degraded performance. | | 15 | Power Save - Standby | The device is not functioning but could be brought to full power quickly. | | 16 | Power Cycle | | | 17 | Power Save - Warning | The device is in a warning state, though also in a power save mode. | | 18 | Paused | The device is paused. | | 19 | Not Ready | The device is not ready. | | 20 | Not Configured | The device is not configured. | | 21 | Quiesced | The device is quiet. |
Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Availability for each instance
# Lookup table for Availability (values documented by Microsoft)
$availabilityName = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Running/Full Power'
4 = 'Warning'
5 = 'In Test'
6 = 'Not Applicable'
7 = 'Power Off'
8 = 'Off Line'
9 = 'Off Duty'
10 = 'Degraded'
11 = 'Not Installed'
12 = 'Install Error'
13 = 'Power Save - Unknown'
14 = 'Power Save - Low Power Mode'
15 = 'Power Save - Standby'
16 = 'Power Cycle'
17 = 'Power Save - Warning'
18 = 'Paused'
19 = 'Not Ready'
20 = 'Not Configured'
21 = 'Quiesced'
}
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, Availability |
Select-Object -Property @(
'DeviceID'
@{ Name = 'Availability'; Expression = { $availabilityName[[int]$_.Availability] } }
)
|
| BatteryStatus# | uint16 | read | Description of the battery's charge status. The value 10 is not valid in the CIM schema, which represents no battery being installed in Desktop Management Interface (DMI). In this case, the object should not be instantiated. Values (11)| Value | Label | Description |
|---|
| 1 | Other | | | 2 | Unknown | | | 3 | Fully Charged | | | 4 | Low | | | 5 | Critical | | | 6 | Charging | | | 7 | Charging and High | | | 8 | Charging and Low | | | 9 | Charging and Critical | | | 10 | Undefined | | | 11 | Partially Charged | |
Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of BatteryStatus for each instance
# Lookup table for BatteryStatus (values documented by Microsoft)
$batteryStatusName = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Fully Charged'
4 = 'Low'
5 = 'Critical'
6 = 'Charging'
7 = 'Charging and High'
8 = 'Charging and Low'
9 = 'Charging and Critical'
10 = 'Undefined'
11 = 'Partially Charged'
}
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, BatteryStatus |
Select-Object -Property @(
'DeviceID'
@{ Name = 'BatteryStatus'; Expression = { $batteryStatusName[[int]$_.BatteryStatus] } }
)
|
| Caption# | string | read | A short textual description of the object. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Caption for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, Caption |
Select-Object -Property DeviceID, Caption
|
| Chemistry# | uint16 | read | Enumeration that describes the battery's chemistry. Values (8)| Value | Label | Description |
|---|
| 1 | Other | | | 2 | Unknown | | | 3 | Lead Acid | | | 4 | Nickel Cadmium | | | 5 | Nickel Metal Hydride | | | 6 | Lithium-ion | Lithium ion. | | 7 | Zinc air | | | 8 | Lithium Polymer | |
Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Chemistry for each instance
# Lookup table for Chemistry (values documented by Microsoft)
$chemistryName = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Lead Acid'
4 = 'Nickel Cadmium'
5 = 'Nickel Metal Hydride'
6 = 'Lithium-ion'
7 = 'Zinc air'
8 = 'Lithium Polymer'
}
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, Chemistry |
Select-Object -Property @(
'DeviceID'
@{ Name = 'Chemistry'; Expression = { $chemistryName[[int]$_.Chemistry] } }
)
|
| ConfigManagerErrorCode# | uint32 | read | Win32 Configuration Manager error code. Values (32)| Value | Label | Description |
|---|
| 0 | This device is working properly. | | | 1 | This device is not configured correctly. | | | 2 | Windows cannot load the driver for this device. | | | 3 | The driver for this device might be corrupted, or your system may be running low on memory or other resources. | | | 4 | This device is not working properly. One of its drivers or your registry might be corrupted. | | | 5 | The driver for this device needs a resource that Windows cannot manage. | | | 6 | The boot configuration for this device conflicts with other devices. | | | 7 | Cannot filter. | | | 8 | The driver loader for the device is missing. | | | 9 | This device is not working properly because the controlling firmware is reporting the resources for the device incorrectly. | | | 10 | This device cannot start. | | | 11 | This device failed. | | | 12 | This device cannot find enough free resources that it can use. | | | 13 | Windows cannot verify this device's resources. | | | 14 | This device cannot work properly until you restart your computer. | | | 15 | This device is not working properly because there is probably a re-enumeration problem. | | | 16 | Windows cannot identify all the resources this device uses. | | | 17 | This device is asking for an unknown resource type. | | | 18 | Reinstall the drivers for this device. | | | 19 | Failure using the VxD loader. | | | 20 | Your registry might be corrupted. | | | 21 | System failure: Try changing the driver for this device. If that does not work, see your hardware documentation. Windows is removing this device. | | | 22 | This device is disabled. | | | 23 | System failure: Try changing the driver for this device. If that doesn't work, see your hardware documentation. | | | 24 | This device is not present, is not working properly, or does not have all its drivers installed. | | | 25 | Windows is still setting up this device. | | | 26 | Windows is still setting up this device. | | | 27 | This device does not have valid log configuration. | | | 28 | The drivers for this device are not installed. | | | 29 | This device is disabled because the firmware of the device did not give it the required resources. | | | 30 | This device is using an Interrupt Request (IRQ) resource that another device is using. | | | 31 | This device is not working properly because Windows cannot load the drivers required for this device. | |
Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of ConfigManagerErrorCode for each instance
# Lookup table for ConfigManagerErrorCode (values documented by Microsoft)
$configManagerErrorCodeName = @{
0 = 'This device is working properly'
1 = 'This device is not configured correctly'
2 = 'Windows cannot load the driver for this device'
3 = 'The driver for this device might be corrupted, or your…'
4 = 'This device is not working properly'
5 = 'The driver for this device needs a resource that Windows…'
6 = 'The boot configuration for this device conflicts with other…'
7 = 'Cannot filter'
8 = 'The driver loader for the device is missing'
9 = 'This device is not working properly because the controlling…'
10 = 'This device cannot start'
11 = 'This device failed'
12 = 'This device cannot find enough free resources that it can use'
13 = 'Windows cannot verify this device''s resources'
14 = 'This device cannot work properly until you restart your…'
15 = 'This device is not working properly because there is…'
16 = 'Windows cannot identify all the resources this device uses'
17 = 'This device is asking for an unknown resource type'
18 = 'Reinstall the drivers for this device'
19 = 'Failure using the VxD loader'
20 = 'Your registry might be corrupted'
21 = 'System failure: Try changing the driver for this device'
22 = 'This device is disabled'
23 = 'System failure: Try changing the driver for this device'
24 = 'This device is not present, is not working properly, or does…'
25 = 'Windows is still setting up this device'
26 = 'Windows is still setting up this device'
27 = 'This device does not have valid log configuration'
28 = 'The drivers for this device are not installed'
29 = 'This device is disabled because the firmware of the device…'
30 = 'This device is using an Interrupt Request (IRQ) resource…'
31 = 'This device is not working properly because Windows cannot…'
}
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, ConfigManagerErrorCode |
Select-Object -Property @(
'DeviceID'
@{ Name = 'ConfigManagerErrorCode'; Expression = { $configManagerErrorCodeName[[int]$_.ConfigManagerErrorCode] } }
)
|
| ConfigManagerUserConfig# | boolean | read | If TRUE, the device is using a user-defined configuration. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of ConfigManagerUserConfig for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, ConfigManagerUserConfig |
Select-Object -Property DeviceID, ConfigManagerUserConfig
|
| CreationClassName# key | string | read | Name of the class or subclass used in the creation of an instance. When used with other key properties of the class, this property allows all instances of the class and its subclasses to be uniquely identified. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of CreationClassName for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, CreationClassName |
Select-Object -Property DeviceID, CreationClassName
|
| Description# | string | read | A textual description of the object. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Description for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, Description |
Select-Object -Property DeviceID, Description
|
| DesignCapacity# | uint32 | read | Designed capacity of the battery in milliwatt-hours. If this property is not supported, enter 0. Unit: milliwatt-hours Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of DesignCapacity for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, DesignCapacity |
Select-Object -Property DeviceID, DesignCapacity
|
| DesignVoltage# | uint64 | read | Designed voltage of the battery in millivolts. If this attribute is not supported, enter 0. For more information about using uint64 values in scripts, see Scripting in WMI. Unit: millivolts Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of DesignVoltage for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, DesignVoltage |
Select-Object -Property DeviceID, DesignVoltage
|
| DeviceID# key | string | read | Address or other identifying information to uniquely name the logical device. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of DeviceID for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID |
Select-Object -Property DeviceID
|
| ErrorCleared# | boolean | read | If TRUE, the error reported in the LastErrorCode property is now cleared. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of ErrorCleared for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, ErrorCleared |
Select-Object -Property DeviceID, ErrorCleared
|
| ErrorDescription# | string | read | Free-form string that supplies information about the error recorded in the LastErrorCode property and corrective actions to perform. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of ErrorDescription for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, ErrorDescription |
Select-Object -Property DeviceID, ErrorDescription
|
| EstimatedChargeRemaining# | uint16 | read | Estimated percentage of the remaining full charge. Unit: percent Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of EstimatedChargeRemaining for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, EstimatedChargeRemaining |
Select-Object -Property DeviceID, EstimatedChargeRemaining
|
| EstimatedRunTime# | uint32 | read | Estimated time, in minutes, until the battery charge is depleted under the present load conditions if the utility power is off, is lost and remains off, or if a laptop is disconnected from a power source. Unit: minutes Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of EstimatedRunTime for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, EstimatedRunTime |
Select-Object -Property DeviceID, EstimatedRunTime
|
| ExpectedLife# | uint32 | read | Battery's expected lifetime, in minutes, assuming that the battery is fully charged. This property represents the total expected life of the battery, not its current remaining life, which is indicated by the EstimatedRunTime property. Unit: minutes Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of ExpectedLife for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, ExpectedLife |
Select-Object -Property DeviceID, ExpectedLife
|
| FullChargeCapacity# | uint32 | read | The full charge capacity of the battery in milliwatt-hours. Compare this value to the DesignCapacity property to determine when the battery requires replacement. A battery's end-life is typically when the FullChargeCapacity property falls below 80 percent of the DesignCapacity property. If this property is not supported, enter 0. Unit: milliwatt-hours Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of FullChargeCapacity for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, FullChargeCapacity |
Select-Object -Property DeviceID, FullChargeCapacity
|
| InstallDate# | datetime | read | Indicates when the object was installed. Lack of a value does not indicate that the object is not installed. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of InstallDate for each instance
# CIM cmdlets already return a DateTime object: no conversion is needed
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, InstallDate |
Select-Object -Property DeviceID, InstallDate
|
| LastErrorCode# | uint32 | read | Last error code reported by the logical device. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of LastErrorCode for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, LastErrorCode |
Select-Object -Property DeviceID, LastErrorCode
|
| MaxRechargeTime# | uint32 | read | Maximum time, in minutes, to fully charge the battery. This property represents the time to recharge a fully depleted battery, not the current remaining charging time, which is indicated in the TimeToFullCharge property. Unit: minutes Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of MaxRechargeTime for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, MaxRechargeTime |
Select-Object -Property DeviceID, MaxRechargeTime
|
| Name# | string | read | Label by which the object is known. When subclassed, this property can be overridden to be a key property. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Name for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, Name |
Select-Object -Property DeviceID, Name
|
| PNPDeviceID# | string | read | Indicates the Win32 Plug and Play device identifier of the logical device. Example: "*PNP030b" Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of PNPDeviceID for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, PNPDeviceID |
Select-Object -Property DeviceID, PNPDeviceID
|
| PowerManagementCapabilities# | uint16[] | read | Indicates the specific power-related capabilities of the logical device. Values (8)| Value | Label | Description |
|---|
| 0 | Unknown | The power-related capacities are unknown. | | 1 | Not Supported | Power-related capacities are not supported for this device. | | 2 | Disabled | Power-related capacities have been disabled. | | 3 | Enabled | The power management features are currently enabled but the exact feature set is unknown or the information is unavailable. | | 4 | Power Saving Modes Entered Automatically | The device can change its power state based on usage or other criteria. | | 5 | Power State Settable | The **SetPowerState** method is supported. This method is found on the parent CIM_LogicalDevice class and can be implemented. For more information, see Designing Managed Object Format (MOF) Classes. | | 6 | Power Cycling Supported | The **SetPowerState** method can be invoked with the *PowerState* parameter set to 5 ("Power Cycle"). | | 7 | Timed Power On Supported | The **SetPowerState** method can be invoked with the *PowerState* parameter set to 5 ("Power Cycle") and the *Time* parameter set to a specific date and time, or interval, for power-on. |
Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of PowerManagementCapabilities for each instance
# Lookup table for PowerManagementCapabilities (values documented by Microsoft)
$powerManagementCapabilitiesName = @{
0 = 'Unknown'
1 = 'Not Supported'
2 = 'Disabled'
3 = 'Enabled'
4 = 'Power Saving Modes Entered Automatically'
5 = 'Power State Settable'
6 = 'Power Cycling Supported'
7 = 'Timed Power On Supported'
}
# PowerManagementCapabilities is an array: -ExpandProperty returns its items one by one
Get-CimInstance -ClassName CIM_Battery -Property PowerManagementCapabilities |
Select-Object -ExpandProperty PowerManagementCapabilities |
ForEach-Object -Process { $powerManagementCapabilitiesName[[int]$_] }
|
| PowerManagementSupported# | boolean | read | If TRUE, the device can be power managed, that is, put into a power-save state. If FALSE, the integer value 1 ("Not Supported") should be the only entry in the PowerManagementCapabilities array. This property does not indicate whether power management features are currently enabled, or if enabled, which features are supported. For more information, see the PowerManagementCapabilities array. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of PowerManagementSupported for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, PowerManagementSupported |
Select-Object -Property DeviceID, PowerManagementSupported
|
| SmartBatteryVersion# | string | read | Smart battery data-specification version number that is supported by this battery. If the battery does not support this function, the value should be left empty. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of SmartBatteryVersion for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, SmartBatteryVersion |
Select-Object -Property DeviceID, SmartBatteryVersion
|
| Status# | string | read | String that indicates the current status of the object. Operational and non-operational status can be defined. Operational status can include "OK", "Degraded", and "Pred Fail". "Pred Fail" indicates that an element is functioning properly, but is predicting a failure (for example, a SMART-enabled hard disk drive). Non-operational status can include "Error", "Starting", "Stopping", and "Service". "Service" can apply during disk mirror-resilvering, reloading a user permissions list, or other administrative work. Not all such work is online, but the managed element is neither "OK" nor in one of the other states. Values include the following: Values (12)| Value | Label | Description |
|---|
| OK | OK | | | Error | Error | | | Degraded | Degraded | | | Unknown | Unknown | | | Pred Fail | Pred Fail | | | Starting | Starting | | | Stopping | Stopping | | | Service | Service | | | Stressed | Stressed | | | NonRecover | NonRecover | | | No Contact | No Contact | | | Lost Comm | Lost Comm | |
Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of Status for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, Status |
Select-Object -Property DeviceID, Status
|
| StatusInfo# | uint16 | read | State of the logical device. If this property does not apply to the logical device, the value 5 ("Not Applicable") should be used. Values (5)| Value | Label | Description |
|---|
| 1 | Other | | | 2 | Unknown | | | 3 | Enabled | | | 4 | Disabled | | | 5 | Not Applicable | |
Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of StatusInfo for each instance
# Lookup table for StatusInfo (values documented by Microsoft)
$statusInfoName = @{
1 = 'Other'
2 = 'Unknown'
3 = 'Enabled'
4 = 'Disabled'
5 = 'Not Applicable'
}
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, StatusInfo |
Select-Object -Property @(
'DeviceID'
@{ Name = 'StatusInfo'; Expression = { $statusInfoName[[int]$_.StatusInfo] } }
)
|
| SystemCreationClassName# key | string | read | The scoping system's creation class name. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of SystemCreationClassName for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, SystemCreationClassName |
Select-Object -Property DeviceID, SystemCreationClassName
|
| SystemName# key | string | read | The scoping system's name. Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of SystemName for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, SystemName |
Select-Object -Property DeviceID, SystemName
|
| TimeOnBattery# | uint32 | read | Elapsed time, in seconds, since the computer system's UPS last switched to battery power, or the amount of time since the system or UPS was last restarted, whichever is less. A value of 0 is returned if the battery is "online." Unit: seconds Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of TimeOnBattery for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, TimeOnBattery |
Select-Object -Property DeviceID, TimeOnBattery
|
| TimeToFullCharge# | uint32 | read | Remaining time, in minutes, to charge the battery fully at the current charging rate and use. Unit: minutes Code# Abstract class: Get-CimInstance returns the instances of its subclasses
# Value of TimeToFullCharge for each instance
Get-CimInstance -ClassName CIM_Battery -Property DeviceID, TimeToFullCharge |
Select-Object -Property DeviceID, TimeToFullCharge
|