| external help file | Microsoft.PowerShell.Commands.Utility.dll-Help.xml |
|---|---|
| Locale | en-US |
| Module Name | Microsoft.PowerShell.Utility |
| ms.date | 11/06/2025 |
| online version | https://learn.microsoft.com/powershell/module/microsoft.powershell.utility/get-uptime?view=powershell-7.6&WT.mc_id=ps-gethelp |
| schema | 2.0.0 |
| title | Get-Uptime |
Get the TimeSpan since last boot.
Get-Uptime [<CommonParameters>]
Get-Uptime [-Since] [<CommonParameters>]
This cmdlet returns the time elapsed since the last boot of the operating system.
The Get-Uptime cmdlet was introduced in PowerShell 6.0.
Get-UptimeDays : 9
Hours : 0
Minutes : 9
Seconds : 45
Milliseconds : 0
Ticks : 7781850000000
TotalDays : 9.00677083333333
TotalHours : 216.1625
TotalMinutes : 12969.75
TotalSeconds : 778185
TotalMilliseconds : 778185000
Get-Uptime -SinceTuesday, June 18, 2019 2:34:56 PM
Cause the cmdlet to return a DateTime object representing the last time that the operating system was booted.
Type: System.Management.Automation.SwitchParameter
Parameter Sets: Since
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
You can't pipe objects to this cmdlet.
By default, this cmdlet returns a TimeSpan object representing the elapsed time.
When you use the Since parameter, this cmdlet returns a DateTime object representing the last boot time.
This command uses a high resolution timer to calculate the uptime. This time record the number of ticks since the system started. As a result, the reported uptime may differ slightly from other methods of calculating system uptime, such as the LastBootUpTime property of the Win32_OperatingSystem class in WMI.