-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fad1949
commit 679e926
Showing
2 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/GitHub/public/Repositories/Repositories/Get-GitHubRepositoryLanguage.ps1
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
filter Get-GitHubRepositoryLanguage { | ||
<# | ||
.SYNOPSIS | ||
List repository languages | ||
.DESCRIPTION | ||
Lists languages for the specified repository. The value shown for each language is the number of | ||
bytes of code written in that language. | ||
.EXAMPLE | ||
Get-GitHubRepositoryLanguage -Owner 'octocat' -Repo 'hello-world' | ||
Gets the languages for the 'hello-world' repository owned by 'octocat'. | ||
.NOTES | ||
https://docs.github.com/rest/repos/repos#list-repository-languages | ||
#> | ||
[CmdletBinding()] | ||
[Alias('Get-GitHubRepositoryLanguages')] | ||
param ( | ||
# The account owner of the repository. The name is not case sensitive. | ||
[Parameter()] | ||
[Alias('org')] | ||
[string] $Owner = (Get-GitHubConfig -Name Owner), | ||
|
||
# The name of the repository without the .git extension. The name is not case sensitive. | ||
[Parameter()] | ||
[string] $Repo = (Get-GitHubConfig -Name Repo) | ||
) | ||
|
||
$inputObject = @{ | ||
APIEndpoint = "/repos/$Owner/$Repo/languages" | ||
Method = 'GET' | ||
} | ||
|
||
Invoke-GitHubAPI @inputObject | ForEach-Object { | ||
Write-Output $_.Response | ||
} | ||
} |
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