-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #371 from TheJumpCloud/JumpCloudModule_1.20.1
JumpCloud 1.20.1 Release
- Loading branch information
Showing
13 changed files
with
122 additions
and
93 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,4 +1,6 @@ | ||
.DS_Store | ||
.vscode | ||
# Ignore Test Results Directory | ||
*test_results | ||
*test_results | ||
# Ignore support.wiki | ||
*support.wiki |
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
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
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
44 changes: 44 additions & 0 deletions
44
PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.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,44 @@ | ||
Function Get-JCResults | ||
{ | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory = $true, HelpMessage = 'URL of Endpoint')][ValidateNotNullOrEmpty()]$URL | ||
) | ||
begin { | ||
$hdrs = @{ | ||
'Content-Type' = 'application/json' | ||
'Accept' = 'application/json' | ||
'X-API-KEY' = $JCAPIKEY | ||
} | ||
if ($JCOrgID) | ||
{ | ||
$hdrs.Add('x-org-id', "$($JCOrgID)") | ||
} | ||
$resultsArray = @() | ||
$totalCount = 1 | ||
$limit = 100 | ||
$skip = 0 | ||
} | ||
process { | ||
$limitURL = $URL + "?limit=$limit&skip=$skip" | ||
Write-Debug $limitURL | ||
$response = Invoke-WebRequest -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) | ||
$totalCount = $response.Headers."x-total-count" | ||
$totalCount = [int]$totalCount.Trim() | ||
Write-Debug "total count: $totalCount" | ||
$passCounter = [math]::ceiling($totalCount/$limit) | ||
Write-Debug "number of passes: $passCounter" | ||
$resultsArray += $response.Content | ConvertFrom-Json | ||
|
||
for($i = 1; $i -lt $passCounter; $i++) { | ||
$skip += $limit | ||
$limitURL = $URL + "?limit=$limit&skip=$skip" | ||
$response = Invoke-WebRequest -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) | ||
$resultsArray += $response.Content | ConvertFrom-Json | ||
Write-Debug ("Pass: $i Amount: " + ($response.Content | ConvertFrom-Json).Count) | ||
} | ||
} | ||
end { | ||
return $resultsArray | ||
} | ||
} |
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
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
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
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
Empty file.
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#### Latest Version | ||
|
||
``` | ||
1.20.0 | ||
1.20.1 | ||
``` | ||
|
||
#### Banner Current | ||
|
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