I need to get the specific value from powershell output. I need to get the numeric values in poewershell only.
$result =WMIC PATH Win32_Battery Get EstimatedChargeRemaining
CodePudding user response:
Instead of using wmic
you can use a PowerShell built-in cmdlet to query WMI and CIM:
(Get-CimInstance -ClassName Win32_Battery).EstimatedChargeRemaining
See Get-CimInstance
for Official Documentation.