Title: Invoke-RestMethod -FollowRelLink should return a single array of objects · Issue #5526 · PowerShell/PowerShell · GitHub
Open Graph Title: Invoke-RestMethod -FollowRelLink should return a single array of objects · Issue #5526 · PowerShell/PowerShell
X Title: Invoke-RestMethod -FollowRelLink should return a single array of objects · Issue #5526 · PowerShell/PowerShell
Description: Invoke-RestMethod with the -FollowRelLink parameter correctly retrieves additional pages of results from REST services. However, the return is an array of pages rather than one array of all results. Steps to reproduce PS /> $apikey = 'MY...
Open Graph Description: Invoke-RestMethod with the -FollowRelLink parameter correctly retrieves additional pages of results from REST services. However, the return is an array of pages rather than one array of all results...
X Description: Invoke-RestMethod with the -FollowRelLink parameter correctly retrieves additional pages of results from REST services. However, the return is an array of pages rather than one array of all results...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/5526
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Invoke-RestMethod -FollowRelLink should return a single array of objects","articleBody":"Invoke-RestMethod with the -FollowRelLink parameter correctly retrieves additional pages of results from REST services. However, the return is an array of pages rather than one array of all results.\r\n\r\n\r\nSteps to reproduce\r\n------------------\r\n\r\n```powershell\r\nPS /\u003e $apikey = 'MYAPIKEYHERE'\r\nPS /\u003e $headers = @{'Accept'='application/json';'Content-Type'='application/json';'Authorization'=\"SSWS $apikey\"}\r\nPS /\u003e\r\nPS /\u003e $users = Invoke-RestMethod -Uri 'https://MYORGNAME.okta.com/api/v1/users/?filter=status eq \"ACTIVE\"\u0026limit=10' -Method GET -Headers $headers -FollowRelLink -MaximumFollowRelLink 3\r\nPS /\u003e\r\nPS /\u003e $users.Count\r\n3\r\nPS /\u003e $users.Item(0).Count\r\n10\r\nPS /\u003e $users.Item(1).Count\r\n10\r\nPS /\u003e $users.Item(2).Count\r\n10\r\nPS /\u003e\r\n```\r\n\r\nExpected behavior\r\n-----------------\r\n\r\n```none\r\nInvoke-RestMethod should return a single array of objects instead of an array of arrays (pages).\r\n\r\nPS /\u003e $users.Count\r\n30\r\n```\r\n\r\nActual behavior\r\n---------------\r\n\r\n```none\r\nInvoke-RestMethod returns an array of arrays (pages).\r\n```\r\n\r\nEnvironment data\r\n----------------\r\n\r\n```powershell\r\nPS /\u003e $PSVersionTable \r\nName Value\r\n---- -----\r\nPSVersion 6.0.0-rc\r\nPSEdition Core\r\nGitCommitId v6.0.0-rc\r\nOS Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014\r\nPlatform Unix\r\nPSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}\r\nPSRemotingProtocolVersion 2.3\r\nSerializationVersion 1.1.0.1\r\nWSManStackVersion 3.0\r\n\r\n\r\nPS /\u003e\r\n```\r\n","author":{"url":"https://github.com/dddugan","@type":"Person","name":"dddugan"},"datePublished":"2017-11-22T15:25:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":13},"url":"https://github.com/5526/PowerShell/issues/5526"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:46c9fc70-5b16-9e4a-abcd-c66c530e22e0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9954:385FD:10D7E93:18127A3:6A589E80 |
| html-safe-nonce | 8f67c6e6a2c99f17ddc2416173bd3e873415d8528005f939da2456a8f789f21f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OTU0OjM4NUZEOjEwRDdFOTM6MTgxMjdBMzo2QTU4OUU4MCIsInZpc2l0b3JfaWQiOiIyMTY3ODM2MTE2ODIwNDY3MzI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d01ba79bc7a50a522076083bca57d2b3edf07a679e0dfe8eae9d812d6c8b1be1 |
| hovercard-subject-tag | issue:276107614 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/5526/issue_layout |
| twitter:image | https://opengraph.githubassets.com/cbb96fe846778217a3a7808b044a19c8cebd23c62c303a71b0901ad24524c9f7/PowerShell/PowerShell/issues/5526 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/cbb96fe846778217a3a7808b044a19c8cebd23c62c303a71b0901ad24524c9f7/PowerShell/PowerShell/issues/5526 |
| og:image:alt | Invoke-RestMethod with the -FollowRelLink parameter correctly retrieves additional pages of results from REST services. However, the return is an array of pages rather than one array of all results... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dddugan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f2a0c7865178af3d91dd9f13b0cdfc3c73a2529c873d2780bb4c01271a57ec6 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8aae7b8d6caacacf5c66eaeb2702d8dc88d85b4a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width