Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions TOOL-Get-Uptime/Get-Uptime.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ function Get-Uptime {
# Prepare output
$Uptime = New-TimeSpan -Start $($CimResult.lastbootuptime) -End (Get-Date)

$Properties = @{
$Properties = [Ordered]@{
ComputerName = $CIMComputer
Days = $Uptime.days
Hours = $Uptime.hours
Expand Down Expand Up @@ -147,13 +147,13 @@ function Get-Uptime {
$HumanTimeFormat = $Result.ConvertToDateTime($Result.Lastbootuptime)
$Uptime = New-TimeSpan -Start $HumanTimeFormat -End $(Get-Date)

$Properties = @{
$Properties = [Ordered]@{
ComputerName = $Computer
Days = $Uptime.days
Hours = $Uptime.hours
Minutes = $Uptime.minutes
Seconds = $Uptime.seconds
LastBootUpTime = $CimResult.lastbootuptime
LastBootUpTime = $HumanTimeFormat
}
# Output the information
New-Object -TypeName PSObject -Property $Properties
Expand All @@ -170,4 +170,4 @@ function Get-Uptime {
}#FOREACH
} #ELSE (Not CIM)
}#PROCESS
}#Function
}#Function