다음을 통해 공유


Get-Uptime

Get the TimeSpan since last boot.

구문

Timespan (기본값)

Get-Uptime
    [<CommonParameters>]

Since

Get-Uptime
    [-Since]
    [<CommonParameters>]

Description

This cmdlet returns the time elapsed since the last boot of the operating system.

The Get-Uptime cmdlet was introduced in PowerShell 6.0.

예제

Example 1 - Show time since last boot

Get-Uptime
Days              : 9
Hours             : 0
Minutes           : 9
Seconds           : 45
Milliseconds      : 0
Ticks             : 7781850000000
TotalDays         : 9.00677083333333
TotalHours        : 216.1625
TotalMinutes      : 12969.75
TotalSeconds      : 778185
TotalMilliseconds : 778185000

Example 2 - Show the time of the last boot

Get-Uptime -Since
Tuesday, June 18, 2019 2:34:56 PM

매개 변수

-Since

Cause the cmdlet to return a DateTime object representing the last time that the operating system was booted.

매개 변수 속성

형식:SwitchParameter
Default value:None
와일드카드 지원:False
DontShow:False

매개 변수 집합

Since
Position:Named
필수:False
파이프라인의 값:False
속성 이름별 파이프라인의 값:False
나머지 인수의 값:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

입력

None

You can't pipe objects to this cmdlet.

출력

TimeSpan

By default, this cmdlet returns a TimeSpan object representing the elapsed time.

DateTime

When you use the Since parameter, this cmdlet returns a DateTime object representing the last boot time.

Note

If Windows fast startup is enabled, Windows does not update the value stored in LastBootUpTime. To disable fast startup, run the following command: Powercfg -h off.

For more information about Windows fast startup, see Distinguishing Fast Startup from Wake-from-Hibernation.

참고

On Windows, the value returned is the same as the LastBootUpTime property of the Win32_OperatingSystem class in WMI.