Created
March 9, 2017 19:07
-
-
Save TheRealNoob/93ea1bf11c6df76480edc1a8f6de5e18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Powershell Version: x.x | |
Write-host -ForegroundColor Green -BackgroundColor Black ("PowerShell Version: " + (Get-Host | Select-Object -ExpandProperty Version)) | |
## System Uptime: xx:xx:xX | |
$UpTime = [Management.ManagementDateTimeConverter]::ToDateTime((Get-WmiObject Win32_OperatingSystem).LastBootUpTime) | |
$UpTime = (Get-Date) - $Uptime | |
$UpTime = "{0:D2}" -f [int]$UpTime.Days + ':' + "{0:D2}" -f [int]$UpTime.Hours + ':' + "{0:D2}" -f [int]$UpTime.Minutes + ':' + "{0:D2}" -f [int]$UpTime.Seconds | |
Write-Host -ForegroundColor Green -BackgroundColor Black "System Uptime: $($UpTime)" | |
"`n" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment