Created
April 4, 2017 19:51
-
-
Save TheRealNoob/2a3f8d1ca0d8992995c8673ce4ecdf2b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| $array = @() | |
| ## Powershell Version: x.x | |
| $array += @("PowerShell Version",(Get-Host | Select-Object -ExpandProperty Version).tostring()) | |
| ## 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 | |
| $array += @("System Uptime",$UpTime) | |
| $array | Format-List |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment