Update Get-TimedScreenshot.ps1

Fix error handling and various style problems