We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd53712 commit 217e81eCopy full SHA for 217e81e
git/github-api.ps1
@@ -0,0 +1,14 @@
1
+Clear-Host
2
+$PersonalAccessToken = "github_pat_[your_personal_access_token]"
3
+
4
+$GitHubApiUrl = "https://api.github.com/user/repos"
5
+# $GitHubApiUrl = "https://api.github.com/orgs/PowerShellLibrary/repos"
6
+# $GitHubApiUrl = "https://api.github.com/repositories"
7
8
+$Headers = @{
9
+ Authorization = "token $PersonalAccessToken"
10
+ "User-Agent" = "PowerShell" # GitHub API requires a User-Agent header
11
+}
12
13
+$response = Invoke-RestMethod -Uri $GitHubApiUrl -Method Get -Headers $Headers
14
+$response
0 commit comments