Earlier this year I wrote a PowerShell module to get uptime information. The module was part of a series I wrote for Petri.com. As part of my ongoing project to move some of my more interesting, and hopefully useful, tools to GitHub, I revised the module. The new version makes better use of custom format…
Tag: Uptime
More with Service Uptime
I knew I wasn’t totally satisfied with my recent attempt at listing service uptime. I knew there was a more elegant solution and here it is: $s=Get-WmiObject -query “Select name,processId,state from Win32_service where state=’running'”foreach ($item in $s) {$p=(Get-Process | Where {$_.id -eq $item.ProcessID}).StartTime$u=(get-date).Subtract($p)Write-Host $item.Name `t $u.Days day $u.hours hours $u.minutes minutes and $u.seconds seconds} It…