【问题标题】:HP BIOS Battery Health SettingsHP BIOS 电池运行状况设置
【发布时间】:2021-02-23 15:10:37
【问题描述】:

我正在尝试使用 PowerShell 更改 BIOS 电池充电设置,并将最终使用 Intune 进行部署。我对这样做很感兴趣,因为我有一些用户让他们的电脑全时插上电源,这会在一年内毁掉电池。更改此设置将仅允许计算机充电至指定限制,这有望延长电池的整体使用寿命。

我的代码出现问题,提示“术语 ' ' 未被识别为 cmdlet、函数、脚本文件或可运行程序的名称”。我正在使用以下文档来创建脚本,并且正在使用已验证在 BIOS 中具有此设置的 HP 计算机。

https://developers.hp.com/hp-client-management/blog/managing-battery-health-settings-hpcmsl-and-intune

$setting = Get-HPBIOSSettingValue -Name "Battery Health Manager"
if ($setting -eq "Let HP manage my battery charging") {
        exit 0
}
Set-HPBIOSSettingValue -Name "Battery Health Manager" -value "Let HP manage my battery charging"
exit 0

出于本练习的目的,我真的不需要测试检测脚本,因为我已经知道此设置的设置。有谁知道我做错了什么?当我将它保存为 .ps1 时,该脚本也失败了。我有一种感觉,因为我是 powershell 新手,所以我缺少一些非常基本的东西。

【问题讨论】:

标签: powershell battery batterylevel intune batterymanager


【解决方案1】:

听起来您没有安装 HP Powershell 模块。

命令 Get-HPBIOSSettingValueSet-HPBIOSSettingValue 不是 Windows 原生的 - 您需要下载相关的 HP 模块并安装它 - 试试 Powershell Gallery。

【讨论】:

  • 这就是问题所在。我现在可以使用上面的 Powershell 脚本通过 intune 推送电池配置文件。我必须将 HP 客户端管理脚本库打包为 Intune 中的 Win32 应用程序,这很有效。
猜你喜欢
  • 2017-10-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-04-23
  • 2010-11-26
  • 1970-01-01
  • 2020-08-02
相关资源
最近更新 更多