Tuesday, December 15, 2015

Everyday Powershell - Part 36 - Check-EliteDangerous

So as this is typed the game Elite Dangerous is being patched to version 1.5 when the patch is done we'll be able to land our ships on planets!!! PLANETS!

We're all pretty excited by this and want to know as soon as the game is ready to play again. Well here's where powershell can help!

$issuesstring = (ConvertFrom-Json (invoke-webrequest http://hosting.zaonce.net/launcher-status/status.json).content).text
while ((ConvertFrom-Json (invoke-webrequest http://hosting.zaonce.net/launcher-status/status.json).content).text -eq $issuesstring){
    Write-host ((get-date).tostring() + " " + $issuesstring)
    Start-Sleep -Seconds 300
}
Write-Warning "We're on!"
[Reflection.Assembly]::LoadWithPartialName('System.Speech'| Out-Null
(New-Object System.Speech.Synthesis.SpeechSynthesizer).Speak("Go get em commander!")

Simple loop that'll tell you when then status changes.

No comments:

Post a Comment