{"id":3587,"date":"2022-04-26T12:07:17","date_gmt":"2022-04-26T11:07:17","guid":{"rendered":"http:\/\/roglacup.com\/klaus62\/?p=3587"},"modified":"2022-04-27T14:47:00","modified_gmt":"2022-04-27T13:47:00","slug":"powershell-uptime","status":"publish","type":"post","link":"https:\/\/roglacup.com\/klaus62\/2022\/04\/26\/powershell-uptime\/","title":{"rendered":"Powershell &#038; Uptime"},"content":{"rendered":"\n<p>If you are running Windows PowerShell 5 or older, you can use the CIM\u00a0Instance method and the\u00a0<strong>Win32_OperatingSystem<\/strong>\u00a0class. The Win32_OperatingSystem class has a\u00a0<strong>LastBootupTime<\/strong>\u00a0property which shows the time when the computer was rebooted.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Get-CimInstance -ClassName Win32_OperatingSystem | Select LastBootUpTime\n\nOutput:\n\n\r\nPS C:\\Users\\xxxx> Get-CimInstance -ClassName Win32_OperatingSystem | Select LastBootUpTime\r\n\r\nLastBootUpTime       \r\n--------------       \r\n15. 10. 2020 21:47:51\r\n<\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are running Windows PowerShell 5 or older, you can use the CIM\u00a0Instance method and the\u00a0Win32_OperatingSystem\u00a0class. The Win32_OperatingSystem class has a\u00a0LastBootupTime\u00a0property which shows the time when the computer was rebooted. Get-CimInstance -ClassName Win32_OperatingSystem | Select LastBootUpTime Output: PS C:\\Users\\xxxx> Get-CimInstance -ClassName Win32_OperatingSystem | Select LastBootUpTime LastBootUpTime &#8212;&#8212;&#8212;&#8212;&#8211; 15. 10. 2020 21:47:51<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","footnotes":""},"categories":[384,20],"tags":[],"class_list":["post-3587","post","type-post","status-publish","format-standard","hentry","category-computer-science","category-script"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/3587","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/comments?post=3587"}],"version-history":[{"count":2,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/3587\/revisions"}],"predecessor-version":[{"id":3595,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/posts\/3587\/revisions\/3595"}],"wp:attachment":[{"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/media?parent=3587"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/categories?post=3587"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roglacup.com\/klaus62\/wp-json\/wp\/v2\/tags?post=3587"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}