1 2 3 4 5 6 7 |
'const { exec } = require("child_process"); exec("$ComputerSystem=Get-WmiObject Win32_ComputerSystem;$BaseBoard=Get-WmiObject Win32_BaseBoard;$BIOS=Get-WmiObject Win32_BIOS;$Processor=Get-WmiObject Win32_Processor;[PSCustomObject]@{ Model = $ComputerSystem.Model; ManufacturerBoard = $BaseBoard.Manufacturer; BIOSVersion = $BIOS.SMbiosbiosversion; BIOSSerialNumber = $BIOS.serialnumber; ManufacturerProcessor=$Processor.Manufacturer; MaxClockSpeed=$Processor.MaxClockSpeed}", {"shell":"powershell.exe"}, (error, stdout, stderr)=> { console.log(stdout); })' | Out-File ejecutarpower.js -Encoding utf8 node .\ejecutarpower.js |