title: Powershell - check for last time computers were restarted
body: <p>I need to make sure all computers are being restarted at least once a week, and I've been googling on it, and I found something, but it's... rather something simple, something... 1-timer... What I want is to make it a bit more advanced.</p>
  <p>Here's the command I found online:</p>
  <pre><code>Get-WmiObject Win32_OperatingSystem -ComputerName &lt;computername&gt; : select cname, @(LABEL='LastBootUpTime' ;EXPRESSION=($_.ConverttoDateTime($_.lastbootuptime)))
  </code></pre>
  <p>(I'm not sure if sharing the links is a good idea here, but I just googled for &quot;check when remote computer was last restarted&quot; and clicked on a link on enterprisedaddy)</p>
  <p>I do not know anything about PowerShell, so I'm asking for your help. Also, it may be useful not only to me, but to others as well...</p>
  <p>Here's what I want:</p>
  <ol>
  <li>Create the *.ps1 file (I can do that) and make it run it 24/7</li>
  <li>Instead of copying all computers each time, I want to append new computers to the list, because otherwise, the list would be very, very long... and I don't want to be deleting a whole bunch of computers and making sure only 1 copy is left and deleting all other every day...</li>
  <li>Export the list into either *.txt or (even better) *.csv</li>
  <li>At the end of the day, the *.ps1 would create a new *.txt or *.csv file and start it all over. In a new file. Of course leaving the old one (or all others, starting day 2...) for the review...</li>
  </ol>
  <p>I understand there's very little hope, but if you can help me - great. If not - well, it may take forever to google for it all, but in the end, I may be able to find it all myself... Although there is even less hope here...</p>
  <p>To be fair, all I need is to see the last time the computers were restarted, and that's all, so if you know of an easier way - I'm ready to read about other ideas.</p>