0 Answers
$computer = “LocalHost”
$namespace = “root\CIMV2”
$a = Get-WmiObject -class Win32_OperatingSystem -computername $computer -namespace $namespace
$a | gm
$a.lastbootuptime
思路是:WMI对象:Win32_OperatingSystem
如果要现成脚本,这里有:
Get-Uptime PowerShell Script