这是我当前的脚本的样子:
$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)
我希望它只是数字,以便我进行计算。