可以通过使用 Win32_LocalTime WMI 类检索指定计算机上的当前本地时间 。
PS C:\Users\maxsu> Get-CimInstance -ClassName Win32_LocalTime
Day : 8
DayOfWeek : 6
Hour : 17
Milliseconds :
Minute : 41
Month : 2
Quarter : 1
Second : 39
WeekInMonth : 2
Year : 2020
PSComputerName :