-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathGet-GitHubStatusComponent.ps1
More file actions
49 lines (40 loc) · 1.25 KB
/
Get-GitHubStatusComponent.ps1
File metadata and controls
49 lines (40 loc) · 1.25 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
function Get-GitHubStatusComponent {
<#
.SYNOPSIS
Gets the status of GitHub components
.DESCRIPTION
Get the components for the page. Each component is listed along with its status - one of operational,
degraded_performance, partial_outage, or major_outage.
.EXAMPLE
```powershell
Get-GitHubStatusComponent
```
Gets the status of GitHub components
.NOTES
[Components](https://www.githubstatus.com/api#components)
.LINK
https://psmodule.io/GitHub/Functions/Status/Get-GitHubStatusComponent
#>
[OutputType([pscustomobject[]])]
[Alias('Get-GitHubStatusComponents')]
[CmdletBinding()]
param(
# 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]
$APIURI = "$baseURL/api/v2/components.json"
$response = Invoke-RestMethod -Uri $APIURI -Method Get
$response.components
}
end {
Write-Debug "[$stackPath] - End"
}
}