Created
May 2, 2019 23:17
-
-
Save timothywarner/5001b43b86b0dca57a20bd123cc493a5 to your computer and use it in GitHub Desktop.
Get Azure global service status quickly and with no authentication needed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to Will Anderson for the inspiration (timw.info/rss) | |
Function Get-AzServiceStatus { | |
BEGIN { | |
Try { | |
Invoke-WebRequest -Uri 'https://azurecomcdn.azureedge.net/en-us/status/feed/' -OutFile "$env:TEMP\test.xml" -ErrorAction Stop | |
}#EndTry | |
Catch [System.Exception] { | |
$WebReqErr = $error[0] | Select-Object * | Format-List -Force | |
Write-Error "An error occurred while attempting to connect to the requested site. The error was $WebReqErr.Exception" | |
}#EndCatch | |
[xml]$Content = Get-Content "$env:TEMP\test.xml" | |
$Feed = $Content.rss.channel | |
}#EndBEGIN | |
PROCESS { | |
ForEach ($msg in $Feed.Item) { | |
$title = $msg.title | |
$description = $msg.description -replace '(<p>|<\/p>)', '' | |
[PSCustomObject]@{ | |
'Title' = $title | |
'Description' = $description | |
}#EndPSCustomObject | |
}#EndForEach | |
}#EndPROCESS | |
}#EndFunction | |
Get-AzServiceStatus | Format-List |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment