From 7139ed8aaa30e72e409057be504f33be9dad514f Mon Sep 17 00:00:00 2001 From: Ken Maranion Date: Thu, 7 Apr 2022 09:26:23 -0700 Subject: [PATCH 01/35] GH and PWSHGallery website uptime check --- .../Authentication/Connect-JCOnline.ps1 | 41 ++++++++++++++++++- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 4dffaf07d..9d26b6a7d 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -171,8 +171,45 @@ Function Connect-JCOnline () { If ([System.String]::IsNullOrEmpty($env:JcUpdateModule) -or $env:JcUpdateModule -eq 'True') { - $env:JcUpdateModule = $false - Update-JCModule | Out-Null + $JCGhChangelog = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/ModuleChangelog.md' + $JCGhBanner = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/ModuleBanner.md' + $JCPwshGallery = 'https://www.powershellgallery.com/packages/JumpCloud/' + $moduleSites = @($JCPwshGallery,$JCGhChangelog,$JCGhBanner) + $downRepo = @() + foreach($site in $moduleSites){ + $HTTP_Request = [System.Net.WebRequest]::Create($site) + + try { + + $HTTP_Response = $HTTP_Request.GetResponse() + + } + catch [System.Net.WebException]{ + $HTTP_Response = $_.Exception.Response + } + $HTTP_Status = [int]$HTTP_Response.StatusCode + + If ($HTTP_Status -eq 200) {} #Site is working properly + Else { + $downRepo += $site + } + # Clean up the http request by closing it. + If ($HTTP_Response -eq $null) { } + Else { $HTTP_Response.Close() } + } + # Check if all 3 sites are down + if ($downRepo.Count -gt 1) + { + Write-Warning ("Unable to update the module to repositories being down" ) + } + else + { + $env:JcUpdateModule = $false + Update-JCModule | Out-Null + } + + + } If ($IndShowMessages) { From 5ac967f83f6596de159f14155b750ec6b108d44f Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Thu, 7 Apr 2022 16:41:17 +0000 Subject: [PATCH 02/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 4 ++-- PowerShell/ModuleBanner.md | 12 +++++----- PowerShell/ModuleChangelog.md | 22 +++++++++++++++++++ 4 files changed, 30 insertions(+), 10 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 37c0076e8..787e1e14c 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -2,7 +2,7 @@ Module Name: JumpCloud Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646 Download Help Link: https://github.com/TheJumpCloud/support/wiki -Help Version: 1.19.0 +Help Version: 1.19.1 Locale: en-US --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 2cc77b113..c17cd1e50 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 3/7/2022 +# Generated on: 4/7/2022 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.19.0' +ModuleVersion = '1.19.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index 5ad7f4bef..dcfa08683 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,19 +1,17 @@ #### Latest Version ``` -1.19.0 +1.19.1 ``` #### Banner Current ``` -* New Function, Backup-JCOrganization -* https://github.com/TheJumpCloud/support/tree/master/PowerShell/JumpCloud%20Module/Docs/Backup-JCOrganization.md -* Get-JCBackup will no longer be supported and will soon be deprecated; Please use Backup-JCOrganization.``` +{{Fill in the Banner Current}} +``` #### Banner Old ``` -* New Function, Backup-JCOrganization -* https://github.com/TheJumpCloud/support/tree/master/PowerShell/JumpCloud%20Module/Docs/Backup-JCOrganization.md -* Get-JCBackup will no longer be supported and will soon be deprecated; Please use Backup-JCOrganization.``` +{{Fill in the Banner Old}} +``` diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index ad13362b9..78f7ab2d3 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.19.1 + +Release Date: April 07, 2022 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.19.0 Release Date: March 7, 2022 From 0d122888e4d134035f01050a0e7729575835fbf3 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Thu, 7 Apr 2022 15:48:19 -0600 Subject: [PATCH 03/35] -ge vs -gt --- .../Authentication/Connect-JCOnline.ps1 | 25 ++++++++----------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 9d26b6a7d..06729ad25 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -171,45 +171,40 @@ Function Connect-JCOnline () { If ([System.String]::IsNullOrEmpty($env:JcUpdateModule) -or $env:JcUpdateModule -eq 'True') { - $JCGhChangelog = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/ModuleChangelog.md' - $JCGhBanner = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/ModuleBanner.md' - $JCPwshGallery = 'https://www.powershellgallery.com/packages/JumpCloud/' - $moduleSites = @($JCPwshGallery,$JCGhChangelog,$JCGhBanner) + # Update-JCModule depends on these resources being available, check if available then continue + $moduleSites = @( + 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/ModuleChangelog.md', + 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/ModuleBanner.md', + 'https://www.powershellgallery.com/packages/JumpCloud/' + ) $downRepo = @() foreach($site in $moduleSites){ $HTTP_Request = [System.Net.WebRequest]::Create($site) - try { - $HTTP_Response = $HTTP_Request.GetResponse() - } catch [System.Net.WebException]{ $HTTP_Response = $_.Exception.Response } $HTTP_Status = [int]$HTTP_Response.StatusCode - If ($HTTP_Status -eq 200) {} #Site is working properly Else { $downRepo += $site } # Clean up the http request by closing it. - If ($HTTP_Response -eq $null) { } + If ($HTTP_Response -eq $null) { } Else { $HTTP_Response.Close() } } - # Check if all 3 sites are down - if ($downRepo.Count -gt 1) + # If one of the 3 sites are inaccessible, skip running Update-JCModule + if ($downRepo.Count -ge 1) { - Write-Warning ("Unable to update the module to repositories being down" ) + Write-Verbose ("One or more of the required resources to update the JumpCloud Module are inaccessible at the moment" ) } else { $env:JcUpdateModule = $false Update-JCModule | Out-Null } - - - } If ($IndShowMessages) { From cdc4ae3b2a637692d2ff37da692d51d0718a0dd6 Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Thu, 7 Apr 2022 22:02:47 +0000 Subject: [PATCH 04/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- PowerShell/ModuleBanner.md | 2 +- PowerShell/ModuleChangelog.md | 22 +++++++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 787e1e14c..8de137ccd 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -2,7 +2,7 @@ Module Name: JumpCloud Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646 Download Help Link: https://github.com/TheJumpCloud/support/wiki -Help Version: 1.19.1 +Help Version: 1.20.1 Locale: en-US --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index c17cd1e50..3b4d999d7 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.19.1' +ModuleVersion = '1.20.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index dcfa08683..d6c90cafd 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,7 +1,7 @@ #### Latest Version ``` -1.19.1 +1.20.1 ``` #### Banner Current diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 78f7ab2d3..b913e1b3a 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.20.1 + +Release Date: April 07, 2022 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.19.1 Release Date: April 07, 2022 From 185937e163bebc8d4f09010289cd3e1689908237 Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Fri, 8 Apr 2022 14:58:33 +0000 Subject: [PATCH 05/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 4 ++-- PowerShell/ModuleBanner.md | 7 +++--- PowerShell/ModuleChangelog.md | 22 +++++++++++++++++++ 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index ffe9bbdd2..3611f0ae2 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -2,7 +2,7 @@ Module Name: JumpCloud Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646 Download Help Link: https://github.com/TheJumpCloud/support/wiki -Help Version: 1.20.0 +Help Version: 1.21.0 Locale: en-US --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index b40c847ed..6772677c3 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/7/2022 +# Generated on: 4/8/2022 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.20.0' +ModuleVersion = '1.21.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index 2a3459374..3062e58e5 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,18 +1,17 @@ #### Latest Version ``` -1.20.0 +1.21.0 ``` #### Banner Current ``` -* Get-JcUser, Set-JcUser and New-JcUser will soon be deprecating the -suspended parameter. Please use the -state paramater as a replacement. +{{Fill in the Banner Current}} ``` #### Banner Old ``` -* New Function, Backup-JCOrganization -* https://github.com/TheJumpCloud/support/tree/master/PowerShell/JumpCloud%20Module/Docs/Backup-JCOrganization.md +{{Fill in the Banner Old}} ``` diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 6b29fcaab..20d9237d4 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.21.0 + +Release Date: April 08, 2022 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.20.0 Release Date: March 31, 2022 From 31af06c6288bbed50689dcb1059fe28bf7089ef7 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Tue, 12 Apr 2022 10:52:57 -0600 Subject: [PATCH 06/35] revert path change form last week --- .gitignore | 4 +++- PowerShell/Deploy/Build-WikiPages.ps1 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 695e760d5..009f2affe 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .DS_Store .vscode # Ignore Test Results Directory -*test_results \ No newline at end of file +*test_results +# Ignore support.wiki +*support.wiki \ No newline at end of file diff --git a/PowerShell/Deploy/Build-WikiPages.ps1 b/PowerShell/Deploy/Build-WikiPages.ps1 index c18f545ae..3e9705a53 100755 --- a/PowerShell/Deploy/Build-WikiPages.ps1 +++ b/PowerShell/Deploy/Build-WikiPages.ps1 @@ -2,7 +2,7 @@ ########################################################################### Invoke-GitClone -Repo:($GitSourceRepoWiki) $SupportRepoDocs = "$FolderPath_Module/Docs" -$SupportWiki = "$ScriptRoot/../support.wiki" +$SupportWiki = "$ScriptRoot/support.wiki" If (!(Test-Path -Path:($SupportWiki))) { New-Item -Path:($SupportWiki) -ItemType:('Directory') } Set-Location -Path:($SupportWiki) $Docs = Get-ChildItem -Path:($SupportRepoDocs + '/*.md') -Recurse From 870672d1362efc9040a8f746e60db34934e11a58 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 12 Apr 2022 10:58:43 -0600 Subject: [PATCH 07/35] test with dry run --- .circleci/workflows.yml | 1 + PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 68929a937..44d86323f 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -81,6 +81,7 @@ workflows: - Build Modules - Initial Setup context: aws-credentials + - Publish Wiki Docs - Build Nuspec: requires: - Initial Setup diff --git a/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 b/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 index 197222145..07c6f1199 100644 --- a/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 +++ b/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 @@ -36,6 +36,6 @@ Function Global:Invoke-GitCommit{ Invoke-Git -Arguments:('status;') Invoke-Git -Arguments:('remote;') Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";') - Invoke-Git -Arguments:('push origin ' + 'master' + ';') + Invoke-Git -Arguments:('push origin ' + 'master' + ' --dry-run' + ';') } } \ No newline at end of file From f868396d5271b80a35bda71ea93882a2e31a6468 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 12 Apr 2022 10:59:50 -0600 Subject: [PATCH 08/35] sequence of events --- .circleci/workflows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 44d86323f..92e5531f0 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -82,6 +82,10 @@ workflows: - Initial Setup context: aws-credentials - Publish Wiki Docs + requires: + - Build Modules + - Initial Setup + - Build Help and Test Files - Build Nuspec: requires: - Initial Setup From 758acfed862d6266334a2849fdb99f1ae858a0a3 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 12 Apr 2022 11:00:33 -0600 Subject: [PATCH 09/35] missing : --- .circleci/workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 92e5531f0..2ebaaf796 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -81,7 +81,7 @@ workflows: - Build Modules - Initial Setup context: aws-credentials - - Publish Wiki Docs + - Publish Wiki Docs: requires: - Build Modules - Initial Setup From d9b8d686bc1f0b74201a9486c34d041c6bc3962d Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Tue, 12 Apr 2022 17:13:43 +0000 Subject: [PATCH 10/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 4 ++-- PowerShell/ModuleBanner.md | 7 +++--- PowerShell/ModuleChangelog.md | 22 +++++++++++++++++++ 4 files changed, 28 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index ffe9bbdd2..3611f0ae2 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -2,7 +2,7 @@ Module Name: JumpCloud Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646 Download Help Link: https://github.com/TheJumpCloud/support/wiki -Help Version: 1.20.0 +Help Version: 1.21.0 Locale: en-US --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index b40c847ed..1cc941a92 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/7/2022 +# Generated on: 4/12/2022 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.20.0' +ModuleVersion = '1.21.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index 2a3459374..3062e58e5 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,18 +1,17 @@ #### Latest Version ``` -1.20.0 +1.21.0 ``` #### Banner Current ``` -* Get-JcUser, Set-JcUser and New-JcUser will soon be deprecating the -suspended parameter. Please use the -state paramater as a replacement. +{{Fill in the Banner Current}} ``` #### Banner Old ``` -* New Function, Backup-JCOrganization -* https://github.com/TheJumpCloud/support/tree/master/PowerShell/JumpCloud%20Module/Docs/Backup-JCOrganization.md +{{Fill in the Banner Old}} ``` diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 6b29fcaab..82fb43111 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.21.0 + +Release Date: April 12, 2022 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.20.0 Release Date: March 31, 2022 From 49695b58b6511427ddb0fb0be6fc92a21e8d3b64 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 12 Apr 2022 11:19:42 -0600 Subject: [PATCH 11/35] revert changes in invoke gitcommit --- .circleci/workflows.yml | 2 +- PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 2ebaaf796..025e768ab 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -32,7 +32,7 @@ parameters: description: 'Release Type. Accepted values [ Major, Minor, Patch ]' type: enum enum: ["Major", "Minor", "Patch"] - default: "Minor" + default: "Patch" RequiredModulesRepo: description: 'PowerShell Repository for JumpCloud SDKs' type: enum diff --git a/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 b/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 index 07c6f1199..40318f2d1 100644 --- a/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 +++ b/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 @@ -36,6 +36,6 @@ Function Global:Invoke-GitCommit{ Invoke-Git -Arguments:('status;') Invoke-Git -Arguments:('remote;') Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";') - Invoke-Git -Arguments:('push origin ' + 'master' + ' --dry-run' + ';') + Invoke-Git -Arguments:('push origin HEAD:refs/heads/' + $BranchName + ' --dry-run' + ';') } } \ No newline at end of file From 23b1ff9214dcd6f802d4e594b7301a3f19700922 Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Tue, 12 Apr 2022 17:32:19 +0000 Subject: [PATCH 12/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- PowerShell/ModuleBanner.md | 2 +- PowerShell/ModuleChangelog.md | 22 +++++++++++++++++++ 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 3611f0ae2..8de137ccd 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -2,7 +2,7 @@ Module Name: JumpCloud Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646 Download Help Link: https://github.com/TheJumpCloud/support/wiki -Help Version: 1.21.0 +Help Version: 1.20.1 Locale: en-US --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 1cc941a92..0c49d0499 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.21.0' +ModuleVersion = '1.20.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index 3062e58e5..d6c90cafd 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,7 +1,7 @@ #### Latest Version ``` -1.21.0 +1.20.1 ``` #### Banner Current diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 82fb43111..c03009f31 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.20.1 + +Release Date: April 12, 2022 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.21.0 Release Date: April 12, 2022 From ddc188b838d5c1f921708eb178ee0abdafd3c5c9 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Tue, 12 Apr 2022 13:56:28 -0600 Subject: [PATCH 13/35] revert git commit --- PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 b/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 index 40318f2d1..07c6f1199 100644 --- a/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 +++ b/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 @@ -36,6 +36,6 @@ Function Global:Invoke-GitCommit{ Invoke-Git -Arguments:('status;') Invoke-Git -Arguments:('remote;') Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";') - Invoke-Git -Arguments:('push origin HEAD:refs/heads/' + $BranchName + ' --dry-run' + ';') + Invoke-Git -Arguments:('push origin ' + 'master' + ' --dry-run' + ';') } } \ No newline at end of file From 8babf221b5cadd952cb9c3a2ceabad648d29e0a2 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Tue, 12 Apr 2022 15:49:00 -0600 Subject: [PATCH 14/35] set location --- .circleci/workflows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 025e768ab..ef497d3d7 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -373,7 +373,8 @@ commands: name: 'Publish Wiki Documentaiton' shell: pwsh.exe command: | - ./PowerShell/Deploy/Build-WikiPages.ps1 + Set-Location -Path:('./PowerShell/Deploy') + .Build-WikiPages.ps1 invoke-script: steps: - checkout From 70d8325a33a663f09b2018e00828d26e0593bd69 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Tue, 12 Apr 2022 16:07:50 -0600 Subject: [PATCH 15/35] temp fix to clone in the correct location --- .circleci/workflows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index ef497d3d7..f4f3333e1 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -373,8 +373,8 @@ commands: name: 'Publish Wiki Documentaiton' shell: pwsh.exe command: | - Set-Location -Path:('./PowerShell/Deploy') - .Build-WikiPages.ps1 + Set-Location -Path "./project/PowerShell/Deploy" + ./Build-WikiPages.ps1 invoke-script: steps: - checkout From b099d343f3821acf2d32b35d76c5c9276864ca38 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Wed, 13 Apr 2022 08:27:50 -0600 Subject: [PATCH 16/35] paths --- .circleci/workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index f4f3333e1..c41095551 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -373,7 +373,7 @@ commands: name: 'Publish Wiki Documentaiton' shell: pwsh.exe command: | - Set-Location -Path "./project/PowerShell/Deploy" + Set-Location -Path "./PowerShell/Deploy/" ./Build-WikiPages.ps1 invoke-script: steps: From f5f10063928681eb306d15d7e5994c8d1ae3792c Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Wed, 13 Apr 2022 14:47:25 +0000 Subject: [PATCH 17/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 0c49d0499..ecb8b317f 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/12/2022 +# Generated on: 4/13/2022 # @{ From 1bc329145e330f90816b3d0ed4407a6ea9ba6e67 Mon Sep 17 00:00:00 2001 From: CircleCI Date: Wed, 13 Apr 2022 08:48:33 -0600 Subject: [PATCH 18/35] revert testing workflows.yaml & Invoke-GitCommit --- .circleci/workflows.yml | 5 ----- PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index c41095551..8f97ecc25 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -81,11 +81,6 @@ workflows: - Build Modules - Initial Setup context: aws-credentials - - Publish Wiki Docs: - requires: - - Build Modules - - Initial Setup - - Build Help and Test Files - Build Nuspec: requires: - Initial Setup diff --git a/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 b/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 index 07c6f1199..197222145 100644 --- a/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 +++ b/PowerShell/Deploy/Functions/Invoke-GitCommit.ps1 @@ -36,6 +36,6 @@ Function Global:Invoke-GitCommit{ Invoke-Git -Arguments:('status;') Invoke-Git -Arguments:('remote;') Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";') - Invoke-Git -Arguments:('push origin ' + 'master' + ' --dry-run' + ';') + Invoke-Git -Arguments:('push origin ' + 'master' + ';') } } \ No newline at end of file From 85e91f686223b4b58be41c92d461d78d84543675 Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Wed, 13 Apr 2022 16:30:15 +0000 Subject: [PATCH 19/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 4 ++-- PowerShell/ModuleBanner.md | 2 +- PowerShell/ModuleChangelog.md | 22 +++++++++++++++++++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 8de137ccd..3611f0ae2 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -2,7 +2,7 @@ Module Name: JumpCloud Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646 Download Help Link: https://github.com/TheJumpCloud/support/wiki -Help Version: 1.20.1 +Help Version: 1.21.0 Locale: en-US --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 4d16272b9..6f265530d 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/8/2022 +# Generated on: 4/13/2022 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.20.1' +ModuleVersion = '1.21.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index d6c90cafd..3062e58e5 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,7 +1,7 @@ #### Latest Version ``` -1.20.1 +1.21.0 ``` #### Banner Current diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index a24ee1b0d..ea942c5f7 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.21.0 + +Release Date: April 13, 2022 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.20.1 Release Date: April 08, 2022 From 5f10796a09c664282fddfb488f572050022dbecd Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Thu, 21 Apr 2022 14:48:07 -0500 Subject: [PATCH 20/35] create private pagination function --- .../Private/NestedFunctions/Get-JCResults.ps1 | 37 +++++++++++++++++++ .../SystemGroups/Get-JCSystemGroupMember.ps1 | 18 +++++---- 2 files changed, 47 insertions(+), 8 deletions(-) create mode 100644 PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 diff --git a/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 b/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 new file mode 100644 index 000000000..bfec0905c --- /dev/null +++ b/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 @@ -0,0 +1,37 @@ +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 + } + $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" + 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 ($response.Content | ConvertFrom-Json).Count + } + return $resultsArray + } +} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 index 27e0b4b59..a859e05ee 100644 --- a/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 +++ b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 @@ -77,14 +77,16 @@ Function Get-JCSystemGroupMember () [int]$skip = 0 #Do not change! Write-Debug "Setting skip to $skip" - while ($rawResults.Count -ge $skip) - { - $limitURL = "$JCUrlBasePath/api/v2/Systemgroups/$Group_ID/members?limit=$limit&skip=$skip" - Write-Debug $limitURL - $results = Invoke-RestMethod -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) - $skip += $limit - $rawResults += $results - } + # while ($rawResults.Count -ge $skip) + # { + # $limitURL = "$JCUrlBasePath/api/v2/Systemgroups/$Group_ID/members?limit=$limit&skip=$skip" + # Write-Debug $limitURL + # $results = Invoke-RestMethod -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) + # $skip += $limit + # $rawResults += $results + # } + + $rawResults = Get-JCResults -Url "$JCUrlBasePath/api/v2/Systemgroups/$Group_ID/members" foreach ($uid in $rawResults) { From eb0eac59d63f8feda55eb9a621f8f22b261d88a2 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Thu, 21 Apr 2022 17:47:11 -0500 Subject: [PATCH 21/35] adjustments --- .../Private/NestedFunctions/Get-JCResults.ps1 | 10 +++++-- .../SystemGroups/Get-JCSystemGroupMember.ps1 | 28 +++++++++++-------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 b/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 index bfec0905c..c10e1e182 100644 --- a/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 +++ b/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 @@ -16,10 +16,11 @@ Function Get-JCResults $skip = 0 } process { - $limitURL = "$URL?limit=$limit&skip=$skip" + $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" @@ -27,11 +28,14 @@ Function Get-JCResults for($i = 1; $i -lt $passCounter; $i++) { $skip += $limit - $limitURL = "$URL?limit=$limit&skip=$skip" + $limitURL = $URL + "?limit=$limit&skip=$skip" + #Write-Debug $limitURL $response = Invoke-WebRequest -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) $resultsArray += $response.Content | ConvertFrom-Json - Write-Debug ($response.Content | ConvertFrom-Json).Count + Write-Debug ("Pass: $i Amount: " + ($response.Content | ConvertFrom-Json).Count) } + } + end { return $resultsArray } } \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 index a859e05ee..5a4a76b6e 100644 --- a/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 +++ b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 @@ -74,8 +74,8 @@ Function Get-JCSystemGroupMember () $Group_ID = $GroupNameHash.Get_Item($Group) Write-Debug "$Group_ID" - [int]$skip = 0 #Do not change! - Write-Debug "Setting skip to $skip" + # [int]$skip = 0 #Do not change! + # Write-Debug "Setting skip to $skip" # while ($rawResults.Count -ge $skip) # { @@ -86,7 +86,8 @@ Function Get-JCSystemGroupMember () # $rawResults += $results # } - $rawResults = Get-JCResults -Url "$JCUrlBasePath/api/v2/Systemgroups/$Group_ID/members" + $limitURL = "{0}/api/v2/Systemgroups/{1}/members" -f $JCUrlBasePath, $Group_ID + $rawResults = Get-JCResults -Url $limitURL foreach ($uid in $rawResults) { @@ -114,17 +115,20 @@ Function Get-JCSystemGroupMember () elseif ($PSCmdlet.ParameterSetName -eq 'ByID') { - [int]$skip = 0 #Do not change! + # [int]$skip = 0 #Do not change! - while ($resultsArray.Count -ge $skip) - { + # while ($resultsArray.Count -ge $skip) + # { - $limitURL = "$JCUrlBasePath/api/v2/Systemgroups/$ByID/members?limit=$limit&skip=$skip" - Write-Debug $limitURL - $results = Invoke-RestMethod -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) - $skip += $limit - $resultsArray += $results - } + # $limitURL = "$JCUrlBasePath/api/v2/Systemgroups/$ByID/members?limit=$limit&skip=$skip" + # Write-Debug $limitURL + # $results = Invoke-RestMethod -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) + # $skip += $limit + # $resultsArray += $results + # } + + $limitURL = "{0}/api/v2/Systemgroups/{1}/members" -f $JCUrlBasePath, $ByID + $resultsArray = Get-JCResults -Url $limitURL } } From 3ad870ecca660612fd7e2aba9361bd84252d6483 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Thu, 21 Apr 2022 17:33:27 -0600 Subject: [PATCH 22/35] patch release --- .circleci/workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 68929a937..8cd6bb521 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -32,7 +32,7 @@ parameters: description: 'Release Type. Accepted values [ Major, Minor, Patch ]' type: enum enum: ["Major", "Minor", "Patch"] - default: "Minor" + default: "Patch" RequiredModulesRepo: description: 'PowerShell Repository for JumpCloud SDKs' type: enum From 1f0341237156fdc52c41279acec12db6edec7b12 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Thu, 21 Apr 2022 17:36:37 -0600 Subject: [PATCH 23/35] banner/ changelog --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- PowerShell/ModuleBanner.md | 2 +- PowerShell/ModuleChangelog.md | 22 ++++++++++++++++++++++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index b40c847ed..3b4d999d7 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.20.0' +ModuleVersion = '1.20.1' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index 2a3459374..119d01f6f 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,7 +1,7 @@ #### Latest Version ``` -1.20.0 +1.20.1 ``` #### Banner Current diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 6b29fcaab..570704ef6 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.20.1 + +Release Date: April 21, 2022 + +#### RELEASE NOTES + +``` +This releasse includes a patch to fix pagination where a null system record exists. +``` + +#### FEATURES: + +[state parameter added to module](https://github.com/TheJumpCloud/support/pull/361) see [Managing User State documentation](https://support.jumpcloud.com/support/s/article/Managing-User-States#:~:text=A%20user%20state%20indicates%20where,still%20need%20to%20be%20onboarded.). + +#### IMPROVEMENTS: + +* Import/Update-JCUsersFromCSV will validate that custom attribute values are not null before attempting to Import/Update users. + +#### BUG FIXES: + +N/A + ## 1.20.0 Release Date: March 31, 2022 From 1481bda9e0d374ab75a3ec095d7f448521e9206a Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Thu, 21 Apr 2022 23:48:12 +0000 Subject: [PATCH 24/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- .../Tests/Private/NestedFunctions/Get-JCResults.Tests.ps1 | 0 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 PowerShell/JumpCloud Module/Tests/Private/NestedFunctions/Get-JCResults.Tests.ps1 diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index ffe9bbdd2..8de137ccd 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -2,7 +2,7 @@ Module Name: JumpCloud Module Guid: 31c023d1-a901-48c4-90a3-082f91b31646 Download Help Link: https://github.com/TheJumpCloud/support/wiki -Help Version: 1.20.0 +Help Version: 1.20.1 Locale: en-US --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 3b4d999d7..b3feacc61 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/7/2022 +# Generated on: 4/21/2022 # @{ diff --git a/PowerShell/JumpCloud Module/Tests/Private/NestedFunctions/Get-JCResults.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Private/NestedFunctions/Get-JCResults.Tests.ps1 new file mode 100644 index 000000000..e69de29bb From c366a72086d95836dd1f7c0a11ac2844e58d56cf Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Fri, 22 Apr 2022 11:05:45 -0500 Subject: [PATCH 25/35] add jcorgid header --- .../Private/NestedFunctions/Get-JCResults.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 b/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 index c10e1e182..a63b45c44 100644 --- a/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 +++ b/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCResults.ps1 @@ -10,6 +10,10 @@ Function Get-JCResults 'Accept' = 'application/json' 'X-API-KEY' = $JCAPIKEY } + if ($JCOrgID) + { + $hdrs.Add('x-org-id', "$($JCOrgID)") + } $resultsArray = @() $totalCount = 1 $limit = 100 @@ -29,7 +33,6 @@ Function Get-JCResults for($i = 1; $i -lt $passCounter; $i++) { $skip += $limit $limitURL = $URL + "?limit=$limit&skip=$skip" - #Write-Debug $limitURL $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) From 97af7f9dcdc052327f90eff80b3fc2fc5971b84f Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Fri, 22 Apr 2022 11:05:57 -0500 Subject: [PATCH 26/35] cleanup --- .../SystemGroups/Get-JCSystemGroupMember.ps1 | 44 +------------------ 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 index 5a4a76b6e..ad6b5d491 100644 --- a/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 +++ b/PowerShell/JumpCloud Module/Public/Groups/SystemGroups/Get-JCSystemGroupMember.ps1 @@ -26,23 +26,6 @@ Function Get-JCSystemGroupMember () Write-Debug 'Verifying JCAPI Key' if ($JCAPIKEY.length -ne 40) {Connect-JConline} - Write-Debug 'Populating API headers' - $hdrs = @{ - - 'Content-Type' = 'application/json' - 'Accept' = 'application/json' - 'X-API-KEY' = $JCAPIKEY - - } - - if ($JCOrgID) - { - $hdrs.Add('x-org-id', "$($JCOrgID)") - } - - [int]$limit = '100' - Write-Debug "Setting limit to $limit" - Write-Debug 'Initilizing resultsArray and results ArraryByID' $rawResults = @() $resultsArray = @() @@ -57,7 +40,6 @@ Function Get-JCSystemGroupMember () } - process { @@ -74,18 +56,6 @@ Function Get-JCSystemGroupMember () $Group_ID = $GroupNameHash.Get_Item($Group) Write-Debug "$Group_ID" - # [int]$skip = 0 #Do not change! - # Write-Debug "Setting skip to $skip" - - # while ($rawResults.Count -ge $skip) - # { - # $limitURL = "$JCUrlBasePath/api/v2/Systemgroups/$Group_ID/members?limit=$limit&skip=$skip" - # Write-Debug $limitURL - # $results = Invoke-RestMethod -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) - # $skip += $limit - # $rawResults += $results - # } - $limitURL = "{0}/api/v2/Systemgroups/{1}/members" -f $JCUrlBasePath, $Group_ID $rawResults = Get-JCResults -Url $limitURL @@ -107,7 +77,7 @@ Function Get-JCSystemGroupMember () } - else { Throw "Group does not exist. Run 'Get-JCGroup -type System' to see a list of all your JumpCloud System groups."} + else { Throw "Group does not exist. Run 'Get-JCGroup -type System' to see a list of all your JumpCloud System groups." } } } @@ -115,18 +85,6 @@ Function Get-JCSystemGroupMember () elseif ($PSCmdlet.ParameterSetName -eq 'ByID') { - # [int]$skip = 0 #Do not change! - - # while ($resultsArray.Count -ge $skip) - # { - - # $limitURL = "$JCUrlBasePath/api/v2/Systemgroups/$ByID/members?limit=$limit&skip=$skip" - # Write-Debug $limitURL - # $results = Invoke-RestMethod -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) - # $skip += $limit - # $resultsArray += $results - # } - $limitURL = "{0}/api/v2/Systemgroups/{1}/members" -f $JCUrlBasePath, $ByID $resultsArray = Get-JCResults -Url $limitURL From 2ddb7aba6bbdb7e2911e3b9a77daefa1a955518e Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Fri, 22 Apr 2022 16:45:15 +0000 Subject: [PATCH 27/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index b3feacc61..fe5e1153c 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/21/2022 +# Generated on: 4/22/2022 # @{ From 0a889e4ca1800e0c48564adb93edc724017fee82 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 25 Apr 2022 13:47:16 -0500 Subject: [PATCH 28/35] add pagination function to get-jcusergroupmembership --- .../UserGroups/Get-JCUserGroupMember.ps1 | 45 +++---------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 b/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 index b269805aa..4e65b70a6 100644 --- a/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 +++ b/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 @@ -19,23 +19,6 @@ Function Get-JCUserGroupMember () Write-Debug 'Verifying JCAPI Key' if ($JCAPIKEY.length -ne 40) {Connect-JConline} - Write-Debug 'Populating API headers' - $hdrs = @{ - - 'Content-Type' = 'application/json' - 'Accept' = 'application/json' - 'X-API-KEY' = $JCAPIKEY - - } - - if ($JCOrgID) - { - $hdrs.Add('x-org-id', "$($JCOrgID)") - } - - [int]$limit = '100' - Write-Debug "Setting limit to $limit" - Write-Debug 'Initilizing resultsArray and results ArraryByID' $rawResults = @() $resultsArray = @() @@ -67,17 +50,9 @@ Function Get-JCUserGroupMember () $Group_ID = $GroupNameHash.Get_Item($Group) Write-Debug "$Group_ID" - [int]$skip = 0 #Do not change! - Write-Debug "Setting skip to $skip" - - while ($rawResults.Count -ge $skip) - { - $limitURL = "$JCUrlBasePath/api/v2/usergroups/$Group_ID/members?limit=$limit&skip=$skip" - Write-Debug $limitURL - $results = Invoke-RestMethod -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) - $skip += $limit - $rawResults += $results - } + $limitURL = "{0}/api/v2/usergroups/{1}/members" -f $JCUrlBasePath, $Group_ID + Write-Debug $limitURL + $rawResults = Get-JCResults -Url $limitURL foreach ($uid in $rawResults) { @@ -105,17 +80,9 @@ Function Get-JCUserGroupMember () elseif ($PSCmdlet.ParameterSetName -eq 'ByID') { - [int]$skip = 0 #Do not change! - - while ($resultsArray.Count -ge $skip) - { - - $limitURL = "$JCUrlBasePath/api/v2/usergroups/$ByID/members?limit=$limit&skip=$skip" - Write-Debug $limitURL - $results = Invoke-RestMethod -Method GET -Uri $limitURL -Headers $hdrs -UserAgent:(Get-JCUserAgent) - $skip += $limit - $resultsArray += $results - } + $limitURL = "{0}/api/v2/usergroups/{1}/members" -f $JCUrlBasePath, $Group_ID + Write-Debug $limitURL + $resultsArray = Get-JCResults -Url $limitURL } } From bdc17c71886ed57884957393af9961f8ad0ce82b Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Mon, 25 Apr 2022 19:04:50 +0000 Subject: [PATCH 29/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index fe5e1153c..a86ab59ea 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/22/2022 +# Generated on: 4/25/2022 # @{ From 62718819bf7a9c14541955d946f5071a11e530fa Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 26 Apr 2022 10:30:10 -0500 Subject: [PATCH 30/35] fix byid --- .../Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 b/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 index 4e65b70a6..3e5d5f724 100644 --- a/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 +++ b/PowerShell/JumpCloud Module/Public/Groups/UserGroups/Get-JCUserGroupMember.ps1 @@ -80,7 +80,7 @@ Function Get-JCUserGroupMember () elseif ($PSCmdlet.ParameterSetName -eq 'ByID') { - $limitURL = "{0}/api/v2/usergroups/{1}/members" -f $JCUrlBasePath, $Group_ID + $limitURL = "{0}/api/v2/usergroups/{1}/members" -f $JCUrlBasePath, $ByID Write-Debug $limitURL $resultsArray = Get-JCResults -Url $limitURL From 84d32c530451fa6a07d967de97d117b0969de5b8 Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Tue, 26 Apr 2022 15:55:51 +0000 Subject: [PATCH 31/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index a86ab59ea..2e9e64553 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/25/2022 +# Generated on: 4/26/2022 # @{ From 76f0ac9b36f8db6f31b2972c82b9d9d277937ae2 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 26 Apr 2022 15:32:13 -0500 Subject: [PATCH 32/35] adjust regex --- .../Private/NestedFunctions/New-JCCommandFromURL.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/Private/NestedFunctions/New-JCCommandFromURL.ps1 b/PowerShell/JumpCloud Module/Private/NestedFunctions/New-JCCommandFromURL.ps1 index e9920196c..561ebea95 100644 --- a/PowerShell/JumpCloud Module/Private/NestedFunctions/New-JCCommandFromURL.ps1 +++ b/PowerShell/JumpCloud Module/Private/NestedFunctions/New-JCCommandFromURL.ps1 @@ -22,9 +22,9 @@ Function New-JCCommandFromURL $Command = Invoke-WebRequest -Uri $GitHubURL -UseBasicParsing -UserAgent:(Get-JCUserAgent) | Select-Object RawContent - $CodeRaw = (($Command -split '')[1] -split '')[0] # Contain XML escape characters + $CodeRaw = $Command | Select-String '(?<=\)((.|\n|\r)*?)(?=<\/code>)' # Contain XML escape characters - $Code = ((((($CodeRaw -replace "&", "&") -replace "<", "<") -replace ">", ">") -replace """, '"') -Replace "'", "'") # Replace XML character references + $Code = ((((($CodeRaw.Matches.Value.Trim() -replace "&", "&") -replace "<", "<") -replace ">", ">") -replace """, '"') -Replace "'", "'") # Replace XML character references $Name = (((((($Command -split 'Name')[1]) -replace "`n", "") -split '

')[0]) -replace '(\)', '') From 4f00dfd150ccdb60de7d25bdcdb57fc56147b19a Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Thu, 28 Apr 2022 11:02:36 -0500 Subject: [PATCH 33/35] update workflow --- .circleci/workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/workflows.yml b/.circleci/workflows.yml index 8cd6bb521..b24ec72ca 100755 --- a/.circleci/workflows.yml +++ b/.circleci/workflows.yml @@ -45,7 +45,7 @@ parameters: PublishToPSGallery: description: 'When `true` and when run against Master branch, this workflow will publish the latest code to PSGallery' type: boolean - default: false + default: true ManualModuleVersion: description: 'When `true` the pipeline will use the Module Version specified in JumpCloud Module JumpCloud.psd1 file' type: boolean From deef29527073091eedea87bffecf1ce8f34aaedd Mon Sep 17 00:00:00 2001 From: TheJumpCloud Date: Thu, 28 Apr 2022 16:27:15 +0000 Subject: [PATCH 34/35] Updating PowerShell Module;[skip ci] --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 2e9e64553..bd319b64d 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 4/26/2022 +# Generated on: 4/28/2022 # @{ From c0c948cb03fee665778f81c583f5c59c3b2ffea8 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Thu, 28 Apr 2022 14:19:21 -0500 Subject: [PATCH 35/35] banner and changelog --- PowerShell/ModuleBanner.md | 5 +++-- PowerShell/ModuleChangelog.md | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index d6c90cafd..119d01f6f 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -7,11 +7,12 @@ #### Banner Current ``` -{{Fill in the Banner Current}} +* Get-JcUser, Set-JcUser and New-JcUser will soon be deprecating the -suspended parameter. Please use the -state paramater as a replacement. ``` #### Banner Old ``` -{{Fill in the Banner Old}} +* New Function, Backup-JCOrganization +* https://github.com/TheJumpCloud/support/tree/master/PowerShell/JumpCloud%20Module/Docs/Backup-JCOrganization.md ``` diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index ed06dcf2c..e37621e73 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -7,7 +7,6 @@ Release Date: April 28, 2022 ``` This releasse includes a patch to fix pagination where a null system record exists in Get-JCSystemGroupMember. ``` - #### IMPROVEMENTS: * Import/Update-JCUsersFromCSV will validate that custom attribute values are not null before attempting to Import/Update users.