Quick #PowerShell tip to enable status tracking between reboots in scripts…

By | June 23, 2013

I needed a way to track which scripts had been run on machines that were being rebooted between script initiation.

Rather than using more complex methods, I decided that I could just dump a text file onto the desktop so that after the reboot, once logged in I could be reminded of which script ran most recently.

It’s a nice one-liner:

Out-File $env:USERPROFILEdesktop$(($MyInvocation).mycommand.name)’completed successfully’.txt

Simples!

more to follow…

One thought on “Quick #PowerShell tip to enable status tracking between reboots in scripts…

  1. Pingback: “From the Archive” – My Thoughts « An Expected Error Has Occurred

Leave a Reply

Your email address will not be published. Required fields are marked *