diff --git a/Get-BatteryInfo.ps1 b/Get-BatteryInfo.ps1 index 7e95ef3..da90508 100644 --- a/Get-BatteryInfo.ps1 +++ b/Get-BatteryInfo.ps1 @@ -201,12 +201,12 @@ $obj_battery = @() $result = [string]'' } # else (if) - If ($result.Contains("0 h")) { - $result = $result.Replace("0 h","") - } If ($result.Contains("0 min")) { - $result = $result.Replace("0 min","") - } If ($result.Contains("0 sec")) { - $result = $result.Replace("0 sec","") + If ($result.Contains(" 0 h")) { + $result = $result.Replace(" 0 h"," ") + } If ($result.Contains(" 0 min")) { + $result = $result.Replace(" 0 min"," ") + } If ($result.Contains(" 0 sec")) { + $result = $result.Replace(" 0 sec"," ") } # if ($result: first) $result