相关疑难解决方法(0)

如何编写对象的单个属性的值?

这是我当前的脚本的样子:

$cpu = Get-WmiObject win32_processor | select LoadPercentage
logwrite $cpu #this fuction writes $cpu into a .txt file
Run Code Online (Sandbox Code Playgroud)

该文件的输出为:

@{LoadPercentage=4}
Run Code Online (Sandbox Code Playgroud)

我希望它只是数字,以便我进行计算。

powershell logfile select-object get-wmiobject

5
推荐指数
2
解决办法
1394
查看次数