-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathGet-GitHubStatus.ps1
More file actions
72 lines (59 loc) · 2.23 KB
/
Get-GitHubStatus.ps1
File metadata and controls
72 lines (59 loc) · 2.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
function Get-GitHubStatus {
<#
.SYNOPSIS
Gets the status of GitHub services
.DESCRIPTION
Get a summary of the status page, including a status indicator, component statuses, unresolved incidents,
and any upcoming or in-progress scheduled maintenances. Get the status rollup for the whole page. This endpoint
includes an indicator - one of none, minor, major, or critical, as well as a human description of the blended
component status. Examples of the blended status include "All Systems Operational", "Partial System Outage",
and "Major Service Outage".
.EXAMPLE
```powershell
Get-GitHubStatus
```
Gets the status of GitHub services
.EXAMPLE
```powershell
Get-GitHubStatus -Summary
```
Gets a summary of the status page, including a status indicator, component statuses, unresolved incidents,
and any upcoming or in-progress scheduled maintenances.
.NOTES
[Summary](https://www.githubstatus.com/api#summary)
[Status](https://www.githubstatus.com/api#status)
.LINK
https://psmodule.io/GitHub/Functions/Status/Get-GitHubStatus
#>
[OutputType([pscustomobject])]
[CmdletBinding()]
param(
# Gets a summary of the status page, including a status indicator, component statuses, unresolved incidents,
# and any upcoming or in-progress scheduled maintenances.
[Parameter()]
[switch] $Summary,
# The stamp to check status for.
[Parameter()]
[ValidateSet('Public', 'Europe', 'Australia', 'US', 'Japan')]
[string] $Stamp = 'Public'
)
begin {
$stackPath = Get-PSCallStackPath
Write-Debug "[$stackPath] - Start"
}
process {
$baseURL = $script:StatusBaseURL[$Stamp]
if ($Summary) {
$APIURI = "$baseURL/api/v2/summary.json"
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response
return
}
$APIURI = "$baseURL/api/v2/status.json"
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.status
}
end {
Write-Debug "[$stackPath] - End"
}
}