diff --git a/Get Scripts/Get Uptime in Days.ps1 b/Get Scripts/Get Uptime in Days.ps1 new file mode 100644 index 0000000..78b9c3e --- /dev/null +++ b/Get Scripts/Get Uptime in Days.ps1 @@ -0,0 +1,20 @@ +<# +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 \ No newline at end of file