20 lines
514 B
PowerShell
20 lines
514 B
PowerShell
<#
|
|
Author: Gabe Kerntke
|
|
Company: UFS LLC
|
|
Date: 12-05-2024
|
|
|
|
.Synopsis
|
|
|
|
.Modified
|
|
2024-12-05 (GabeK) - Original script created
|
|
|
|
#>
|
|
|
|
#Region Start Script
|
|
If($args.count -eq 0) { $Computer = "." }
|
|
Else { $Computer = $args[0] }
|
|
|
|
$LastBootTime = (Get-WmiObject Win32_OperatingSystem -ComputerName $Computer ).LastBootUpTime
|
|
$UpTime = (New-TimeSpan ([System.Management.ManagementDateTimeconverter]::ToDateTime($LastBootTime)) (Get-Date) | Select-Object -ExpandProperty Days)
|
|
$UpTime
|
|
#Region End Script |