我目前有一个脚本可以恢复正常运行的服务器正常运行时间,但是当我收到服务器正常运行时间的值时,它包括天,分和秒.
以下是我认为需要修改的脚本行:
$os=Get-WmiObject win32_operatingsystem
$uptime=((get-date) - ($os.ConvertToDateTime($os.lastbootuptime))).tostring()
Run Code Online (Sandbox Code Playgroud)
我试过查找选项只返回天; 但一直找不到一个.
这可能吗?
powershell ×1