Last Quarter, 39% visible
Tuesday, November 22, 2016
Monday, November 21, 2016
Thursday, November 17, 2016
Wednesday, November 16, 2016
Tuesday, November 15, 2016
Monday, November 14, 2016
Friday, November 11, 2016
Thursday, November 10, 2016
Tuesday, November 08, 2016
Windows Uptime
(Because supporting the uptime command would be too easy...)
In the Command Prompt
C:\temp>net stats srv | find "since"
Statistics since 10/20/2016 10:02:37 AM
PowerShell v3
PS C:\temp> Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime
csname lastbootuptime
------ --------------
DC1 10/20/2016 11:01:15 AM
It appears that PowerShell doesn't handle the time falling back...
So I created a uptime alias in Powershell. The following will do it in your current shell.
function get-uptime {Get-CimInstance -ClassName win32_operatingsystem | select csname, lastbootuptime}
new-alias uptime get-uptime
To make the alias sticky add these commands to the Microsoft.PowerShell_profile.ps1 file in your profile and enable script execution. Where your profile file is at and how to enable script execution are in the links below.
Useful links
- https://blogs.technet.microsoft.com/heyscriptingguy/2013/03/27/powertip-get-the-last-boot-time-with-powershell/
- https://technet.microsoft.com/en-us/library/ee176913.aspx?f=255&MSPPError=-2147217396
- https://4sysops.com/archives/how-to-create-a-powershell-alias/
- https://technet.microsoft.com/en-us/library/ee176961.aspx?f=255&MSPPError=-2147217396