T
T
Today I learned
Search…
⌃K
README
powershell
How to install PowerShell core on MacOS
How to select custom attributes on an object
How to run powershell in 32 bit mode within 64 bit
How to remove special chars in JSON file format
PowerShell basics
How to install BizTalk roles and features via PowerShell
Check if an AD account is locked
How to uninstall a BizTalk application
Set Powershell to skip SSL certificate checks
How to enable PS Remoting
How to check the system up time
How to use a Select-Object to create your custom object array for you
How to query the Internet behind a NTLM Proxy on a corporate network
Check .NET Framework versions installed
servicefabric
vscode
biztalk
sql
octopus
soapui
nuget
git
Jira
AzureDevOps
domains
azure
jenkins
iis
dotnet
Powered By GitBook

How to check the system up time

If you want to quickly and easily see how long a server has been running for since its last reboot then use this function:
function Get-SystemUptime
{
$os = Get-WmiObject win32_operatingsystem
$uptime = (Get-Date) - ($os.ConvertToDateTime($os.lastbootuptime))
Write-Output "Uptime: $($Uptime.Days) days, $($Uptime.Hours) hours, $($Uptime.Minutes) minutes"
}
Previous
How to enable PS Remoting
Next
How to use a Select-Object to create your custom object array for you
Last modified 2yr ago
Copy link