From 71cd99be8b3bf260ebf44d9dc278c15f2e7f2c6c Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 11 Nov 2025 12:54:39 -0700 Subject: [PATCH 01/47] lint --- .../Authentication/Connect-JCOnline.ps1 | 86 +++++++++---------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 9708f2002..661ea18a9 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -1,6 +1,6 @@ -Function Connect-JCOnline () { +function Connect-JCOnline () { [CmdletBinding()] - Param + param ( [Parameter( ParameterSetName = 'force', @@ -8,7 +8,7 @@ Function Connect-JCOnline () { )] [Switch]$force ) - DynamicParam { + dynamicparam { $Param_JumpCloudApiKey = @{ 'Name' = 'JumpCloudApiKey'; 'Type' = [System.String]; @@ -35,20 +35,20 @@ Function Connect-JCOnline () { 'ValidateSet' = ('production', 'staging'); } # If the $env:JCApiKey is not set then make the JumpCloudApiKey mandatory else set the default value to be the env variable - If ([System.String]::IsNullOrEmpty($env:JCApiKey)) { + if ([System.String]::IsNullOrEmpty($env:JCApiKey)) { $Param_JumpCloudApiKey.Add('Mandatory', $true); - } Else { + } else { $Param_JumpCloudApiKey.Add('Default', $env:JCApiKey); } # If the $env:JCOrgId is set then set the default value to be the env variable - If (-not [System.String]::IsNullOrEmpty($env:JCOrgId)) { + if (-not [System.String]::IsNullOrEmpty($env:JCOrgId)) { $Param_JumpCloudOrgId.Add('Default', $env:JCOrgId); } # If the $env:JCEnvironment is set then set the default value to be the env variable - If (-not [System.String]::IsNullOrEmpty($env:JCEnvironment)) { + if (-not [System.String]::IsNullOrEmpty($env:JCEnvironment)) { $Param_JCEnvironment.Add('Default', $env:JCEnvironment); - } Else { - $Param_JCEnvironment.Add('Default', 'production'); + } else { + $Param_JCEnvironment.Add('Default', 'US'); } # Build output # Build parameter array @@ -60,32 +60,32 @@ Function Connect-JCOnline () { # Creating each parameter $VarName = $_.Name $VarValue = $_.Value - Try { + try { New-DynamicParameter @VarValue | Out-Null - } Catch { + } catch { Write-Error -Message:('Unable to create dynamic parameter:"' + $VarName.Replace($ParamVarPrefix, '') + '"; Error:' + $Error) } } - $IndShowMessages = If ([System.String]::IsNullOrEmpty($JumpCloudApiKey) -and [System.String]::IsNullOrEmpty($JumpCloudOrgId) -and -not [System.String]::IsNullOrEmpty($env:JCApiKey) -and -not [System.String]::IsNullOrEmpty($env:JCOrgId)) { + $IndShowMessages = if ([System.String]::IsNullOrEmpty($JumpCloudApiKey) -and [System.String]::IsNullOrEmpty($JumpCloudOrgId) -and -not [System.String]::IsNullOrEmpty($env:JCApiKey) -and -not [System.String]::IsNullOrEmpty($env:JCOrgId)) { $false - } Else { + } else { $true } - Return $RuntimeParameterDictionary + return $RuntimeParameterDictionary } - Begin { + begin { # Debug message for parameter call $PSBoundParameters | Out-DebugParameter | Write-Debug } - Process { + process { # Load color scheme $JCColorConfig = Get-JCColorConfig # For DynamicParam with a default value set that value and then convert the DynamicParam inputs into new variables for the script to use Invoke-Command -ScriptBlock:($ScriptBlock_DefaultDynamicParamProcess) -ArgumentList:($PsBoundParameters, $PSCmdlet, $RuntimeParameterDictionary) -NoNewScope - Try { + try { #Region Set environment variables that can be used by other scripts # If "$JCEnvironment" is populated or if "$env:JCEnvironment" is not set - If (-not [System.String]::IsNullOrEmpty($JCEnvironment)) { + if (-not [System.String]::IsNullOrEmpty($JCEnvironment)) { # Set $env:JCEnvironment $env:JCEnvironment = $JCEnvironment $global:JCEnvironment = $env:JCEnvironment @@ -102,44 +102,44 @@ Function Connect-JCOnline () { } } # If "$JumpCloudApiKey" is populated set $env:JCApiKey - If (-not [System.String]::IsNullOrEmpty($JumpCloudApiKey)) { + if (-not [System.String]::IsNullOrEmpty($JumpCloudApiKey)) { $env:JCApiKey = $JumpCloudApiKey $global:JCAPIKEY = $env:JCApiKey } # Set $env:JCOrgId in Set-JCOrganization try { - $Auth = If ([System.String]::IsNullOrEmpty($JumpCloudOrgId) -and [System.String]::IsNullOrEmpty($env:JCOrgId)) { + $Auth = if ([System.String]::IsNullOrEmpty($JumpCloudOrgId) -and [System.String]::IsNullOrEmpty($env:JCOrgId)) { Set-JCOrganization -JumpCloudApiKey:($env:JCApiKey) -ErrorVariable api_err - } ElseIf (-not [System.String]::IsNullOrEmpty($JumpCloudOrgId) -and [System.String]::IsNullOrEmpty($env:JCOrgId)) { + } elseif (-not [System.String]::IsNullOrEmpty($JumpCloudOrgId) -and [System.String]::IsNullOrEmpty($env:JCOrgId)) { Set-JCOrganization -JumpCloudApiKey:($env:JCApiKey) -JumpCloudOrgId:($JumpCloudOrgId) -ErrorVariable api_err - } ElseIf ([System.String]::IsNullOrEmpty($JumpCloudOrgId) -and -not [System.String]::IsNullOrEmpty($env:JCOrgId)) { + } elseif ([System.String]::IsNullOrEmpty($JumpCloudOrgId) -and -not [System.String]::IsNullOrEmpty($env:JCOrgId)) { Set-JCOrganization -JumpCloudApiKey:($env:JCApiKey) -JumpCloudOrgId:($env:JCOrgId) -ErrorVariable api_err - } ElseIf (-not [System.String]::IsNullOrEmpty($JumpCloudOrgId) -and -not [System.String]::IsNullOrEmpty($env:JCOrgId) -and $JumpCloudOrgId -ne $env:JCOrgId) { + } elseif (-not [System.String]::IsNullOrEmpty($JumpCloudOrgId) -and -not [System.String]::IsNullOrEmpty($env:JCOrgId) -and $JumpCloudOrgId -ne $env:JCOrgId) { Set-JCOrganization -JumpCloudApiKey:($env:JCApiKey) -JumpCloudOrgId:($JumpCloudOrgId) -ErrorVariable api_err - } Else { + } else { Write-Debug ('The $JumpCloudOrgId supplied matches existing $env:JCOrgId.') Set-JCOrganization -JumpCloudApiKey:($env:JCApiKey) -JumpCloudOrgId:($env:JCOrgId) -ErrorVariable api_err } } catch { Write-Verbose "Error: Unable to validate API Key" } - If (-not [System.String]::IsNullOrEmpty($Auth)) { + if (-not [System.String]::IsNullOrEmpty($Auth)) { # Each time a new org is selected get settings info $global:JCSettingsUrl = $JCUrlBasePath + '/api/settings' $global:JCSettings = Invoke-JCApi -Method:('GET') -Url:($JCSettingsUrl) $global:JCOrgSettings = (Get-JcSdkOrganization -Id $env:JCOrgId).Settings #EndRegion Set environment variables that can be used by other scripts - If (([System.String]::IsNullOrEmpty($JCOrgId)) -or ([System.String]::IsNullOrEmpty($env:JCOrgId))) { + if (([System.String]::IsNullOrEmpty($JCOrgId)) -or ([System.String]::IsNullOrEmpty($env:JCOrgId))) { Write-Error ('Incorrect JumpCloudOrgID OR no network connectivity. You can obtain your Organization Id below your Organization''s Contact Information on the Settings page.') - Break + break } - If (([System.String]::IsNullOrEmpty($JCAPIKEY)) -or ([System.String]::IsNullOrEmpty($env:JCApiKey))) { + if (([System.String]::IsNullOrEmpty($JCAPIKEY)) -or ([System.String]::IsNullOrEmpty($env:JCApiKey))) { Write-Error ('Incorrect API key OR no network connectivity. To locate your JumpCloud API key log into the JumpCloud admin portal. The API key is located with "API Settings" accessible from the drop down in the top right hand corner of the screen') - Break + break } # Check for updates to the module and only prompt if user has not been prompted during the session already - If (!($force)) { - If ([System.String]::IsNullOrEmpty($env:JcUpdateModule) -or $env:JcUpdateModule -eq 'True') { + if (!($force)) { + if ([System.String]::IsNullOrEmpty($env:JcUpdateModule) -or $env:JcUpdateModule -eq 'True') { # Update-JCModule depends on these resources being available, check if available then continue $moduleSites = @( 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/ModuleChangelog.md', @@ -154,14 +154,14 @@ Function Connect-JCOnline () { $HTTP_Response = $_.Exception.Response } $HTTP_Status = [int]$HTTP_Response.StatusCode - If ($HTTP_Status -eq 200) { + if ($HTTP_Status -eq 200) { } #Site is working properly - Else { + else { $downRepo += $site } # Clean up the http request by closing it. - If ($HTTP_Response -eq $null) { - } Else { + if ($HTTP_Response -eq $null) { + } else { $HTTP_Response.Close() } } @@ -173,7 +173,7 @@ Function Connect-JCOnline () { ($updateStatus = Update-JCModule) | Out-Null } } - If ($IndShowMessages) { + if ($IndShowMessages) { Write-Host ('Connection Status:') -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Header) Write-Host ($JCColorConfig.IndentChar) -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Indentation) -NoNewline Write-Host ('Successfully connected to JumpCloud!') -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Body) @@ -188,7 +188,7 @@ Function Connect-JCOnline () { Write-Host ('Notice:') -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Header) Write-Host ($JCColorConfig.IndentChar) -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Indentation) -NoNewline Write-Host $JCConfig.moduleBanner.Message -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Body) - If (-Not $updateStatus) { + if (-not $updateStatus) { # If we recently updated the module, do not update messageCount Set-JCSettingsFile -moduleBannerMessageCount ($JCConfig.moduleBanner.messagecount + 1) } @@ -200,11 +200,11 @@ Function Connect-JCOnline () { # 'JCOrgId' = $Auth.JCOrgId; # 'JCOrgName' = $Auth.JCOrgName; # } - } Else { + } else { Write-Verbose "Error: Unable to set module authentication" } # set Argument Completer(s) which require authentication - $templates = Get-JCSDKPolicyTemplate + $templates = Get-JcSdkPolicyTemplate $global:TemplateNameList = New-Object System.Collections.ArrayList foreach ($template in $templates) { $templateHashObject = [PSCustomObject]@{ @@ -218,13 +218,13 @@ Function Connect-JCOnline () { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) $TypeFilter = $fakeBoundParameter.Name; - $TemplateNameList.Name | Where-Object { $_ -like "${TypeFilter}*" } | Where-Object { $_ -like "${wordToComplete}*" } | Sort-Object -Unique | ForEach-Object { $_ } + $TemplateNameList.Name | Where-Object { $_ -like "${TypeFilter}*" } | Where-Object { $_ -like "${wordToComplete}*" } | Sort-Object -Unique | ForEach-Object { $_ } } - } Catch { - Throw "Unable to authenticate: $_" + } catch { + throw "Unable to authenticate: $_" } } - End { + end { } } From bf17c544b2f1375476ee89611ed8b656a0cfc8b1 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 11 Nov 2025 12:55:04 -0700 Subject: [PATCH 02/47] Add EU region support to Connect-JCOnline Expanded the JCEnvironment parameter to accept 'EU' and 'US' values, updated help message, and added corresponding URL base path for the EU region. This allows users to connect to JumpCloud organizations in the EU region. --- .../Public/Authentication/Connect-JCOnline.ps1 | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 661ea18a9..c6f6ad90d 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -31,8 +31,8 @@ function Connect-JCOnline () { 'Position' = 3; 'ValueFromPipelineByPropertyName' = $true; 'ValidateNotNullOrEmpty' = $true; - 'HelpMessage' = 'Specific to JumpCloud development team to connect to staging dev environment.'; - 'ValidateSet' = ('production', 'staging'); + 'HelpMessage' = 'Enter the region for your JumpCloud organization; "EU" or "production".'; + 'ValidateSet' = ('US', 'staging', 'EU'); } # If the $env:JCApiKey is not set then make the JumpCloudApiKey mandatory else set the default value to be the env variable if ([System.String]::IsNullOrEmpty($env:JCApiKey)) { @@ -90,14 +90,17 @@ function Connect-JCOnline () { $env:JCEnvironment = $JCEnvironment $global:JCEnvironment = $env:JCEnvironment } - $global:JCUrlBasePath = Switch ($JCEnvironment) { - 'production' { + $global:JCUrlBasePath = switch ($JCEnvironment) { + 'US' { "https://console.jumpcloud.com" } 'staging' { "https://console.awsstg.jumpcloud.com" } - Default { + 'EU' { + "https://console.eu.jumpcloud.com" + } + default { Write-Error ('Unknown value for $JCEnvironment.') } } From c0eded8b1152b473c3d95c564d6b86602883252a Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 11 Nov 2025 12:56:06 -0700 Subject: [PATCH 03/47] lint --- .../Private/settings/New-JCSettingsFile.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 b/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 index 9d9b69bf8..a4fcf4fbc 100644 --- a/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 +++ b/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 @@ -11,7 +11,7 @@ function New-JCSettingsFile { begin { # Config should be in /PowerShell/JumpCloudModule/Config.json $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent.FullName - $configFilePath = join-path -path $ModuleRoot -childpath 'Config.json' + $configFilePath = Join-Path -Path $ModuleRoot -ChildPath 'Config.json' # Define Default Settings for the Config file $config = @{ @@ -34,9 +34,9 @@ function New-JCSettingsFile { process { # Calculate the Parallel Setting Field: - if (($config.parallel.Override.value -eq $true) -And ($config.parallel.Eligible.value -eq $true)) { + if (($config.parallel.Override.value -eq $true) -and ($config.parallel.Eligible.value -eq $true)) { $config.parallel.Calculated.value = $false - } elseif (($config.parallel.Override.value -eq $false) -And ($config.parallel.Eligible.value -eq $true)) { + } elseif (($config.parallel.Override.value -eq $false) -and ($config.parallel.Eligible.value -eq $true)) { $config.parallel.Calculated.value = $true } else { $config.parallel.Calculated.value = $false @@ -54,7 +54,7 @@ function New-JCSettingsFile { } end { - if ((test-path -Path $configFilePath) -And ($force)) { + if ((Test-Path -Path $configFilePath) -and ($force)) { $config | ConvertTo-Json | Out-File -FilePath $configFilePath } else { $config | ConvertTo-Json | Out-File -FilePath $configFilePath From 2606f3b8894674e9d15f03dbb0b3761a880e3919 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 11 Nov 2025 13:25:07 -0700 Subject: [PATCH 04/47] PowerShell code formatting settings Added detailed PowerShell code formatting options to .vscode/settings.json, including whitespace, brace, indentation, and alias correction preferences for improved code consistency and readability. --- .vscode/settings.json | 77 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 76 insertions(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index d271761b6..28f186368 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -65,7 +65,82 @@ "editor.formatOnSave": true, "files.trimTrailingWhitespace": true, // powershell settings - "powershell.codeFormatting.preset": "OTBS", + // Adds a space before and after the pipeline operator (`|`) if it is missing. + "powershell.codeFormatting.addWhitespaceAroundPipe": true, + + // Align assignment statements in a hashtable or a DSC Configuration. + "powershell.codeFormatting.alignPropertyValuePairs": true, + + // Replaces aliases with their aliased name. + "powershell.codeFormatting.autoCorrectAliases": true, + + // Removes redundant semicolon(s) at the end of a line where a line terminator is sufficient. + "powershell.codeFormatting.avoidSemicolonsAsLineTerminators": false, + + // Does not reformat one-line code blocks, such as: `if (...) {...} else {...}`. + "powershell.codeFormatting.ignoreOneLineBlock": true, + + // Adds a newline (line break) after a closing brace. + "powershell.codeFormatting.newLineAfterCloseBrace": true, + + // Adds a newline (line break) after an open brace. + "powershell.codeFormatting.newLineAfterOpenBrace": true, + + // Places open brace on the same line as its associated statement. + "powershell.codeFormatting.openBraceOnSameLine": true, + + // Whether to increase indentation after a pipeline for multi-line statements. See [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer/blob/a94d9f5666bba9f569cdf9c1bc99556934f2b8f4/docs/Rules/UseConsistentIndentation.md#pipelineindentation-string-default-value-is-increaseindentationforfirstpipeline) for examples. It is suggested to use `IncreaseIndentationForFirstPipeline` instead of the default `NoIndentation`. **This default may change in the future,** please see the [Request For Comment](https://github.com/PowerShell/vscode-powershell/issues/4296). + // - IncreaseIndentationForFirstPipeline: Indent once after the first pipeline and keep this indentation. + // - IncreaseIndentationAfterEveryPipeline: Indent more after the first pipeline and keep this indentation. + // - NoIndentation: Do not increase indentation. + // - None: Do not change any existing pipeline indentation (disables feature). + "powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline", + + // Sets the code formatting options to follow the given indent style in a way that is compatible with PowerShell syntax. Any setting other than `Custom` will configure (and override) the settings: + // + // * `powershell.codeFormatting.openBraceOnSameLine` + // + // * `powershell.codeFormatting.newLineAfterOpenBrace` + // + // * `powershell.codeFormatting.newLineAfterCloseBrace` + // + // For more information about the brace styles, please see [PoshCode's discussion](https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/81). + // - Custom: The three brace settings are respected as-is. + // - Allman: Sets `powershell.codeFormatting.openBraceOnSameLine#` to `false`, `#powershell.codeFormatting.newLineAfterOpenBrace#` to `true`, and `#powershell.codeFormatting.newLineAfterCloseBrace` to `true`. + // - OTBS: Sets `powershell.codeFormatting.openBraceOnSameLine#` to `true`, `#powershell.codeFormatting.newLineAfterOpenBrace#` to `true`, and `#powershell.codeFormatting.newLineAfterCloseBrace` to `false`. + // - Stroustrup: Sets `powershell.codeFormatting.openBraceOnSameLine#` to `true`, `#powershell.codeFormatting.newLineAfterOpenBrace#` to `true`, and `#powershell.codeFormatting.newLineAfterCloseBrace` to `true`. + "powershell.codeFormatting.preset": "OTBS", + + // Trims extraneous whitespace (more than one character) before and after the pipeline operator (`|`). + "powershell.codeFormatting.trimWhitespaceAroundPipe": true, + + // Use single quotes if a string is not interpolated and its value does not contain a single quote. + "powershell.codeFormatting.useConstantStrings": false, + + // Use correct casing for cmdlets. + "powershell.codeFormatting.useCorrectCasing": true, + + // Adds a space after a separator (`,` and `;`). + "powershell.codeFormatting.whitespaceAfterSeparator": true, + + // Adds spaces before and after an operator (`=`, `+`, `-`, etc.). + "powershell.codeFormatting.whitespaceAroundOperator": true, + + // **Deprecated:** Please use the `powershell.codeFormatting.addWhitespaceAroundPipe` setting instead. If you've used this setting before, we have moved it for you automatically. + // **Deprecated:** Please use the `powershell.codeFormatting.addWhitespaceAroundPipe` setting instead. If you've used this setting before, we have moved it for you automatically. + "powershell.codeFormatting.whitespaceAroundPipe": true, + + // Adds a space between a keyword and its associated script-block expression. + "powershell.codeFormatting.whitespaceBeforeOpenBrace": true, + + // Adds a space between a keyword (`if`, `elseif`, `while`, `switch`, etc.) and its associated conditional expression. + "powershell.codeFormatting.whitespaceBeforeOpenParen": true, + + // Removes redundant whitespace between parameters. + "powershell.codeFormatting.whitespaceBetweenParameters": false, + + // Adds a space after an opening brace (`{`) and before a closing brace (`}`). + "powershell.codeFormatting.whitespaceInsideBrace": true, "powershell.scriptAnalysis.enable": true, "powershell.scriptAnalysis.settingsPath": "PowerShell/JumpCloud Module/Tests/ModuleValidation/PSScriptAnalyzerSettings.psd1", } \ No newline at end of file From 1cd6654e110e745d14455af335a287d45d196014 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 11 Nov 2025 13:30:24 -0700 Subject: [PATCH 05/47] Update settings.json --- .vscode/settings.json | 59 +------------------------------------------ 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 28f186368..c4541fae0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -65,81 +65,24 @@ "editor.formatOnSave": true, "files.trimTrailingWhitespace": true, // powershell settings - // Adds a space before and after the pipeline operator (`|`) if it is missing. "powershell.codeFormatting.addWhitespaceAroundPipe": true, - - // Align assignment statements in a hashtable or a DSC Configuration. "powershell.codeFormatting.alignPropertyValuePairs": true, - - // Replaces aliases with their aliased name. "powershell.codeFormatting.autoCorrectAliases": true, - - // Removes redundant semicolon(s) at the end of a line where a line terminator is sufficient. "powershell.codeFormatting.avoidSemicolonsAsLineTerminators": false, - - // Does not reformat one-line code blocks, such as: `if (...) {...} else {...}`. "powershell.codeFormatting.ignoreOneLineBlock": true, - - // Adds a newline (line break) after a closing brace. "powershell.codeFormatting.newLineAfterCloseBrace": true, - - // Adds a newline (line break) after an open brace. "powershell.codeFormatting.newLineAfterOpenBrace": true, - - // Places open brace on the same line as its associated statement. "powershell.codeFormatting.openBraceOnSameLine": true, - - // Whether to increase indentation after a pipeline for multi-line statements. See [PSScriptAnalyzer](https://github.com/PowerShell/PSScriptAnalyzer/blob/a94d9f5666bba9f569cdf9c1bc99556934f2b8f4/docs/Rules/UseConsistentIndentation.md#pipelineindentation-string-default-value-is-increaseindentationforfirstpipeline) for examples. It is suggested to use `IncreaseIndentationForFirstPipeline` instead of the default `NoIndentation`. **This default may change in the future,** please see the [Request For Comment](https://github.com/PowerShell/vscode-powershell/issues/4296). - // - IncreaseIndentationForFirstPipeline: Indent once after the first pipeline and keep this indentation. - // - IncreaseIndentationAfterEveryPipeline: Indent more after the first pipeline and keep this indentation. - // - NoIndentation: Do not increase indentation. - // - None: Do not change any existing pipeline indentation (disables feature). "powershell.codeFormatting.pipelineIndentationStyle": "IncreaseIndentationForFirstPipeline", - - // Sets the code formatting options to follow the given indent style in a way that is compatible with PowerShell syntax. Any setting other than `Custom` will configure (and override) the settings: - // - // * `powershell.codeFormatting.openBraceOnSameLine` - // - // * `powershell.codeFormatting.newLineAfterOpenBrace` - // - // * `powershell.codeFormatting.newLineAfterCloseBrace` - // - // For more information about the brace styles, please see [PoshCode's discussion](https://github.com/PoshCode/PowerShellPracticeAndStyle/issues/81). - // - Custom: The three brace settings are respected as-is. - // - Allman: Sets `powershell.codeFormatting.openBraceOnSameLine#` to `false`, `#powershell.codeFormatting.newLineAfterOpenBrace#` to `true`, and `#powershell.codeFormatting.newLineAfterCloseBrace` to `true`. - // - OTBS: Sets `powershell.codeFormatting.openBraceOnSameLine#` to `true`, `#powershell.codeFormatting.newLineAfterOpenBrace#` to `true`, and `#powershell.codeFormatting.newLineAfterCloseBrace` to `false`. - // - Stroustrup: Sets `powershell.codeFormatting.openBraceOnSameLine#` to `true`, `#powershell.codeFormatting.newLineAfterOpenBrace#` to `true`, and `#powershell.codeFormatting.newLineAfterCloseBrace` to `true`. "powershell.codeFormatting.preset": "OTBS", - - // Trims extraneous whitespace (more than one character) before and after the pipeline operator (`|`). "powershell.codeFormatting.trimWhitespaceAroundPipe": true, - - // Use single quotes if a string is not interpolated and its value does not contain a single quote. "powershell.codeFormatting.useConstantStrings": false, - - // Use correct casing for cmdlets. "powershell.codeFormatting.useCorrectCasing": true, - - // Adds a space after a separator (`,` and `;`). "powershell.codeFormatting.whitespaceAfterSeparator": true, - - // Adds spaces before and after an operator (`=`, `+`, `-`, etc.). "powershell.codeFormatting.whitespaceAroundOperator": true, - - // **Deprecated:** Please use the `powershell.codeFormatting.addWhitespaceAroundPipe` setting instead. If you've used this setting before, we have moved it for you automatically. - // **Deprecated:** Please use the `powershell.codeFormatting.addWhitespaceAroundPipe` setting instead. If you've used this setting before, we have moved it for you automatically. - "powershell.codeFormatting.whitespaceAroundPipe": true, - - // Adds a space between a keyword and its associated script-block expression. "powershell.codeFormatting.whitespaceBeforeOpenBrace": true, - - // Adds a space between a keyword (`if`, `elseif`, `while`, `switch`, etc.) and its associated conditional expression. "powershell.codeFormatting.whitespaceBeforeOpenParen": true, - - // Removes redundant whitespace between parameters. - "powershell.codeFormatting.whitespaceBetweenParameters": false, - - // Adds a space after an opening brace (`{`) and before a closing brace (`}`). + "powershell.codeFormatting.whitespaceBetweenParameters": true, "powershell.codeFormatting.whitespaceInsideBrace": true, "powershell.scriptAnalysis.enable": true, "powershell.scriptAnalysis.settingsPath": "PowerShell/JumpCloud Module/Tests/ModuleValidation/PSScriptAnalyzerSettings.psd1", From 451f6eb7da2fbf1124414d3e24dffed57fe9db5b Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 11 Nov 2025 14:09:12 -0700 Subject: [PATCH 06/47] fix cspell --- .vscode/settings.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index c4541fae0..2fa14a416 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,12 +1,12 @@ { "cSpell.language": "en", "cSpell.enabled": true, - "cSpell.enableFiletypes": [ - "latex", - "markdown", - "plaintext", - "powershell" - ], + "cSpell.enabledFileTypes": { + "latex": true, + "markdown": true, + "plaintext": true, + "powershell": true + }, // todo highlight settings: "todohighlight.isEnable": true, "todohighlight.isCaseSensitive": true, From 3e693377edef96e90c7ee7b161e9b83285f590c7 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Fri, 21 Nov 2025 11:26:27 -0700 Subject: [PATCH 07/47] Add JCEnvironment location to settings file Introduces a new 'JCEnvironment' section to the settings file to support EU-based organizations. Updates the module banner message to inform users about EU environment support and relevant configuration commands. --- .../Private/settings/New-JCSettingsFile.ps1 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 b/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 index a4fcf4fbc..76ef652f2 100644 --- a/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 +++ b/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 @@ -15,15 +15,18 @@ function New-JCSettingsFile { # Define Default Settings for the Config file $config = @{ - 'moduleBanner' = @{ - 'Message' = @{value = 'JumpCloud PowerShell Module now processes Get requests in parallel, to disable this functionailty run: Set-JCSettingsFile -parallelOverride $true'; write = $false; copy = $false }; + 'moduleBanner' = @{ + 'Message' = @{value = 'JumpCloud PowerShell Module now supports EU based organizations. Use `Set-JCSettingsFile -JCEnvironmentLocation "EU"` or `Connect-JCOnline -JumpCloudAPIKey "APIKEY" -JCEnvironment "EU"` to update'; write = $false; copy = $false }; 'MessageCount' = @{value = 0; write = $true; copy = $false } } - 'parallel' = @{ + 'parallel' = @{ 'Eligible' = @{value = Get-JCParallelValidation; write = $false; copy = $true } 'Override' = @{value = $false; write = $true; copy = $true } 'Calculated' = @{value = $false; write = $false; copy = $true } } + 'JCEnvironment' = @{ + 'Location' = @{value = { if ($global:JCEnvironment -eq 'STANDARD' -or [System.String]::IsNullOrEmpty($global:JCEnvironment)) { 'STANDARD' } else { $global:JCEnvironment } }; write = $true; copy = $true } + } # TODO: in future version, add the updates hash and limit update frequency # 'updates' = @{ # 'Frequency' = @{value = 'day'; write = $true; copy = $true; validateSet = 'day week month' } From 6b651f6c5515fce2a42fb150305a29c4b75bf5b8 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Fri, 21 Nov 2025 11:26:37 -0700 Subject: [PATCH 08/47] Update region handling in Connect-JCOnline Changed region values from 'US' to 'STANDARD' and updated help messages and default values accordingly. Improved environment variable assignment and ensured compatibility with new region naming conventions. --- .../Public/Authentication/Connect-JCOnline.ps1 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index c6f6ad90d..894a64863 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -30,9 +30,9 @@ function Connect-JCOnline () { 'Type' = [System.String]; 'Position' = 3; 'ValueFromPipelineByPropertyName' = $true; - 'ValidateNotNullOrEmpty' = $true; - 'HelpMessage' = 'Enter the region for your JumpCloud organization; "EU" or "production".'; - 'ValidateSet' = ('US', 'staging', 'EU'); + 'ValidateNotNullOrEmpty' = $false; + 'HelpMessage' = 'Enter the region for your JumpCloud organization; "EU" or "STANDARD".'; + 'ValidateSet' = ('STANDARD', 'staging', 'EU'); } # If the $env:JCApiKey is not set then make the JumpCloudApiKey mandatory else set the default value to be the env variable if ([System.String]::IsNullOrEmpty($env:JCApiKey)) { @@ -48,7 +48,7 @@ function Connect-JCOnline () { if (-not [System.String]::IsNullOrEmpty($env:JCEnvironment)) { $Param_JCEnvironment.Add('Default', $env:JCEnvironment); } else { - $Param_JCEnvironment.Add('Default', 'US'); + $Param_JCEnvironment.Add('Default', 'STANDARD'); } # Build output # Build parameter array @@ -85,13 +85,17 @@ function Connect-JCOnline () { try { #Region Set environment variables that can be used by other scripts # If "$JCEnvironment" is populated or if "$env:JCEnvironment" is not set + if ($JCConfig.JCEnvironment.Location -ne 'US') { + $JCEnvironment = $JCConfig.JCEnvironment.Location + } if (-not [System.String]::IsNullOrEmpty($JCEnvironment)) { # Set $env:JCEnvironment $env:JCEnvironment = $JCEnvironment $global:JCEnvironment = $env:JCEnvironment + Set-JCSettingsFile -JCEnvironmentLocation $JCEnvironment } $global:JCUrlBasePath = switch ($JCEnvironment) { - 'US' { + 'STANDARD' { "https://console.jumpcloud.com" } 'staging' { @@ -101,7 +105,7 @@ function Connect-JCOnline () { "https://console.eu.jumpcloud.com" } default { - Write-Error ('Unknown value for $JCEnvironment.') + "https://console.jumpcloud.com" } } # If "$JumpCloudApiKey" is populated set $env:JCApiKey From 76db69975453697c40a2e5dcaaa2c0d27ccdffc1 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Fri, 21 Nov 2025 11:26:46 -0700 Subject: [PATCH 09/47] Add EU endpoint support to Get-JCReport Get-JCReport now checks the JCEnvironment variable and uses the EU API endpoint for report artifact retrieval if set to 'EU'. This improves compatibility for organizations hosted in the EU region. --- .../Public/Reports/Get-JCReport.ps1 | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Reports/Get-JCReport.ps1 b/PowerShell/JumpCloud Module/Public/Reports/Get-JCReport.ps1 index c2fe0e51b..528c564ee 100644 --- a/PowerShell/JumpCloud Module/Public/Reports/Get-JCReport.ps1 +++ b/PowerShell/JumpCloud Module/Public/Reports/Get-JCReport.ps1 @@ -17,10 +17,10 @@ JumpCloud.SDK.DirectoryInsights.Models.IGet200ApplicationJsonItemsItem .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkReport.md #> -Function Get-JCReport { +function Get-JCReport { [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IGet200ApplicationJsonItemsItem])] [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] - Param( + param( [Parameter()] [ArgumentCompleter([JumpCloud.SDK.DirectoryInsights.Support.Sort])] [JumpCloud.SDK.DirectoryInsights.Category('Query')] @@ -35,7 +35,7 @@ Function Get-JCReport { [ValidateSet('json', 'csv')] [String]$Type ) - Begin { + begin { Connect-JCOnline -force | Out-Null $Results = @() $headers = @{ @@ -44,7 +44,7 @@ Function Get-JCReport { "x-org-id" = $Env:JCOrgId } } - Process { + process { switch ($PSCmdlet.ParameterSetName) { List { $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkReport @PSBoundParameters @@ -93,12 +93,16 @@ Function Get-JCReport { if ($ReportGenerationFailure -eq $true) { $Results = $Report } else { - $Results = Invoke-RestMethod -Uri "https://api.jumpcloud.com/insights/directory/v1/reports/$reportID/artifacts/$artifactID/content" -Method GET -Headers $headers + if ($global:JCEnvironment -eq 'EU') { + $Results = Invoke-RestMethod -Uri "https://api.eu.jumpcloud.com/insights/directory/v1/reports/$reportID/artifacts/$artifactID/content" -Method GET -Headers $headers + } else { + $Results = Invoke-RestMethod -Uri "https://api.jumpcloud.com/insights/directory/v1/reports/$reportID/artifacts/$artifactID/content" -Method GET -Headers $headers + } } } } } - End { - Return $Results + end { + return $Results } } From 9984661f8eaa5766a054c34caabee0f676ef2227 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Fri, 21 Nov 2025 11:26:53 -0700 Subject: [PATCH 10/47] Expand settings file modification test Added checks to verify JCEnvironment.location changes in addition to parallelOverride. Ensures both settings are properly updated and tested in Set-JCSettingsFile. --- .../Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 index a06e15e55..3250e450b 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 @@ -1,5 +1,5 @@ Describe -Tag "JCSettingsFile" -Name "Set JCSettings Tests" { - it "Settings File can be modified" { + It "Settings File can be modified" { # Get previous file modified Time $previousModifiedDate = (Get-Item "$PSScriptRoot\..\..\..\Config.json").LastWriteTime # Get old config file: @@ -10,10 +10,16 @@ Describe -Tag "JCSettingsFile" -Name "Set JCSettings Tests" { } else { Set-JCSettingsFile -parallelOverride $true } + if ($oldConfig.JCEnvironment.location -eq 'STANDARD') { + Set-JCSettingsFile -JCEnvironmentLocation 'EU' + } else { + Set-JCSettingsFile -JCEnvironmentLocation 'STANDARD' + } # Get modified config file: $modifiedConfig = Get-JCSettingsFile # Check that the setting was modified $oldConfig.parallel.override | Should -Not -Be $modifiedConfig.parallel.override + $oldConfig.JCEnvironment.location | Should -Not -Be $modifiedConfig.JCEnvironment.location # Get last modified date, this should be different from the file at the start of the test $lastModifiedDate = (Get-Item "$PSScriptRoot\..\..\..\Config.json").LastWriteTime # Test that new config file is actually modified From d59bf5558b7de5fd4eaaf3cbfb0c313218c6e315 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Fri, 21 Nov 2025 11:58:42 -0700 Subject: [PATCH 11/47] Update JCEnvironment location check in Connect-JCOnline Changed the environment location comparison from 'US' to 'STANDARD' in Connect-JCOnline.ps1 to align with updated environment naming conventions. --- .../JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 894a64863..03c01712b 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -85,7 +85,7 @@ function Connect-JCOnline () { try { #Region Set environment variables that can be used by other scripts # If "$JCEnvironment" is populated or if "$env:JCEnvironment" is not set - if ($JCConfig.JCEnvironment.Location -ne 'US') { + if ($JCConfig.JCEnvironment.Location -ne 'STANDARD') { $JCEnvironment = $JCConfig.JCEnvironment.Location } if (-not [System.String]::IsNullOrEmpty($JCEnvironment)) { From 303ada759575dfd2f32c5a6b0c2f077ec97cfac8 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Fri, 21 Nov 2025 12:12:00 -0700 Subject: [PATCH 12/47] change not null or empty --- .../JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 03c01712b..104e0efd3 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -30,7 +30,7 @@ function Connect-JCOnline () { 'Type' = [System.String]; 'Position' = 3; 'ValueFromPipelineByPropertyName' = $true; - 'ValidateNotNullOrEmpty' = $false; + 'ValidateNotNullOrEmpty' = $true; 'HelpMessage' = 'Enter the region for your JumpCloud organization; "EU" or "STANDARD".'; 'ValidateSet' = ('STANDARD', 'staging', 'EU'); } From f662e5a66bd06f204dbdc42f866951e5cd0d8a5e Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Fri, 21 Nov 2025 14:33:44 -0700 Subject: [PATCH 13/47] clone + psdefaultparam --- PowerShell/JumpCloud Module/JumpCloud.psm1 | 15 +++++------ .../Authentication/Connect-JCOnline.ps1 | 25 ++++++++++++------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psm1 b/PowerShell/JumpCloud Module/JumpCloud.psm1 index 17c34bd6c..e602431a7 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psm1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psm1 @@ -1,16 +1,17 @@ # Load all functions from public and private folders $Public = @( Get-ChildItem -Path "$PSScriptRoot/Public/*.ps1" -Recurse ) $Private = @( Get-ChildItem -Path "$PSScriptRoot/Private/*.ps1" -Recurse) -Foreach ($Import in @($Public + $Private)) { - Try { +foreach ($Import in @($Public + $Private)) { + try { . $Import.FullName - } Catch { + } catch { Write-Error -Message "Failed to import function $($Import.FullName): $_" } } # Check to see if parallel processing is available for the session $global:JCConfig = Get-JCSettingsFile +$PSDefaultParameterValues = $global:PSDefaultParameterValues.Clone() # Set default values for function parameters $PSDefaultParameterValues['Invoke-RestMethod:ContentType'] = 'application/json; charset=utf-8' @@ -22,7 +23,7 @@ $PSDefaultParameterValues['Invoke-WebRequest:ContentType'] = 'application/json; [System.Net.ServicePointManager]::DefaultConnectionLimit = 999999; [System.Net.ServicePointManager]::MaxServicePointIdleTime = 600000; [System.Net.ServicePointManager]::MaxServicePoints = 999999; -If ($PSVersionTable.PSEdition -eq 'Core') { +if ($PSVersionTable.PSEdition -eq 'Core') { $PSDefaultParameterValues['Invoke-RestMethod:SkipCertificateCheck'] = $true $PSDefaultParameterValues['Invoke-RestMethod:SkipHeaderValidation'] = $true $PSDefaultParameterValues['Invoke-RestMethod:MaximumRetryCount'] = 1 @@ -32,9 +33,9 @@ If ($PSVersionTable.PSEdition -eq 'Core') { $PSDefaultParameterValues['Invoke-WebRequest:SkipHeaderValidation'] = $true $PSDefaultParameterValues['Invoke-WebRequest:MaximumRetryCount'] = 1 $PSDefaultParameterValues['Invoke-WebRequest:RetryIntervalSec'] = 1 -} Else { +} else { #Ignore SSL errors / do not add policy if it exists - if (-Not [System.Net.ServicePointManager]::CertificatePolicy) { + if (-not [System.Net.ServicePointManager]::CertificatePolicy) { Add-Type @" using System.Net; using System.Security.Cryptography.X509Certificates; @@ -67,7 +68,7 @@ Register-ArgumentCompleter -CommandName Get-JCSystemInsights -ParameterName Tabl param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) $TypeFilter = $fakeBoundParameter.Name; - $SystemInsightsDataSet.Name | Where-Object { $_ -like "${TypeFilter}*" } | Where-Object { $_ -like "${wordToComplete}*" } | Sort-Object -Unique | ForEach-Object { $_ } + $SystemInsightsDataSet.Name | Where-Object { $_ -like "${TypeFilter}*" } | Where-Object { $_ -like "${wordToComplete}*" } | Sort-Object -Unique | ForEach-Object { $_ } } # Export module member Export-ModuleMember -Function $Public.BaseName -Alias * diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 03c01712b..68984aa2a 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -85,27 +85,34 @@ function Connect-JCOnline () { try { #Region Set environment variables that can be used by other scripts # If "$JCEnvironment" is populated or if "$env:JCEnvironment" is not set - if ($JCConfig.JCEnvironment.Location -ne 'STANDARD') { - $JCEnvironment = $JCConfig.JCEnvironment.Location - } if (-not [System.String]::IsNullOrEmpty($JCEnvironment)) { # Set $env:JCEnvironment $env:JCEnvironment = $JCEnvironment $global:JCEnvironment = $env:JCEnvironment - Set-JCSettingsFile -JCEnvironmentLocation $JCEnvironment + # Set-JCSettingsFile -JCEnvironmentLocation $JCEnvironment } - $global:JCUrlBasePath = switch ($JCEnvironment) { + # if ($JCConfig.JCEnvironment.Location -ne 'STANDARD') { + # $JCEnvironment = $JCConfig.JCEnvironment.Location + # } + switch ($JCEnvironment) { 'STANDARD' { - "https://console.jumpcloud.com" + $global:JCUrlBasePath = "https://console.jumpcloud.com" + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" } 'staging' { - "https://console.awsstg.jumpcloud.com" + $global:JCUrlBasePath = "https://console.awsstg.jumpcloud.com" + } 'EU' { - "https://console.eu.jumpcloud.com" + $global:JCUrlBasePath = "https://console.eu.jumpcloud.com" + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.eu" + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.eu" } default { - "https://console.jumpcloud.com" + $global:JCUrlBasePath = "https://console.jumpcloud.com" + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" } } # If "$JumpCloudApiKey" is populated set $env:JCApiKey From 3f27f0c22ad7c96fe6c927b13a909c7c7255e947 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 09:49:21 -0700 Subject: [PATCH 14/47] Set JCEnvironment Location to static 'STANDARD' Replaces dynamic assignment of JCEnvironment Location with a static value of 'STANDARD' in New-JCSettingsFile.ps1. This simplifies the logic and ensures consistent default behavior. --- .../JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 b/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 index 76ef652f2..91a2512ee 100644 --- a/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 +++ b/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 @@ -25,7 +25,7 @@ function New-JCSettingsFile { 'Calculated' = @{value = $false; write = $false; copy = $true } } 'JCEnvironment' = @{ - 'Location' = @{value = { if ($global:JCEnvironment -eq 'STANDARD' -or [System.String]::IsNullOrEmpty($global:JCEnvironment)) { 'STANDARD' } else { $global:JCEnvironment } }; write = $true; copy = $true } + 'Location' = @{value = 'STANDARD'; write = $true; copy = $true } } # TODO: in future version, add the updates hash and limit update frequency # 'updates' = @{ From 539327e0de1eb75a2a939b4e847f8801ec875da3 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 13:35:21 -0700 Subject: [PATCH 15/47] Use JCEnvironment env variable in config file The JCEnvironment value in the generated config file now reflects the JCEnvironment environment variable if set, defaulting to 'STANDARD' otherwise. This allows for dynamic configuration based on environment settings. --- .../JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 b/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 index 91a2512ee..4c60e149d 100644 --- a/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 +++ b/PowerShell/JumpCloud Module/Private/settings/New-JCSettingsFile.ps1 @@ -13,6 +13,7 @@ function New-JCSettingsFile { $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent.FullName $configFilePath = Join-Path -Path $ModuleRoot -ChildPath 'Config.json' + $JCEnvironmentValue = if ($env:JCEnvironment -eq 'STANDARD' -or [System.String]::IsNullOrEmpty($env:JCEnvironment)) { 'STANDARD' } else { $env:JCEnvironment } # Define Default Settings for the Config file $config = @{ 'moduleBanner' = @{ @@ -25,7 +26,7 @@ function New-JCSettingsFile { 'Calculated' = @{value = $false; write = $false; copy = $true } } 'JCEnvironment' = @{ - 'Location' = @{value = 'STANDARD'; write = $true; copy = $true } + 'Location' = @{value = $JCEnvironmentValue; write = $true; copy = $true } } # TODO: in future version, add the updates hash and limit update frequency # 'updates' = @{ From 26af751be719ddfa27b0ab1aae43c50425344079 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 13:35:45 -0700 Subject: [PATCH 16/47] set env variable for JCEnvironment --- .../Public/settings/Set-JCSettingsFile.ps1 | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 b/PowerShell/JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 index 27b43932b..0fc03bd51 100644 --- a/PowerShell/JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 +++ b/PowerShell/JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 @@ -2,11 +2,11 @@ function Set-JCSettingsFile { [CmdletBinding()] param ( ) - DynamicParam { + dynamicparam { $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent.FullName - $configFilePath = join-path -path $ModuleRoot -childpath 'Config.json' + $configFilePath = Join-Path -Path $ModuleRoot -ChildPath 'Config.json' - if (test-path -path $configFilePath) { + if (Test-Path -Path $configFilePath) { $config = Get-Content -Path $configFilePath | ConvertFrom-Json # Create the dictionary $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary @@ -52,14 +52,14 @@ function Set-JCSettingsFile { } begin { if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { - Connect-JCOnline -Force | Out-Null + Connect-JCOnline -force | Out-Null } # Config should be in /PowerShell/JumpCloudModule/Config.json $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent.FullName - $configFilePath = join-path -path $ModuleRoot -childpath 'Config.json' + $configFilePath = Join-Path -Path $ModuleRoot -ChildPath 'Config.json' - if (test-path -path $configFilePath) { + if (Test-Path -Path $configFilePath) { $config = Get-Content -Path $configFilePath | ConvertFrom-Json } else { New-JCSettingsFile @@ -81,13 +81,17 @@ function Set-JCSettingsFile { } } # Re-Calculate Parallel Settings: - if (($config.'parallel'.'Override' -eq $true) -And (($config.'parallel'.'Eligible' -eq $true))) { + if (($config.'parallel'.'Override' -eq $true) -and (($config.'parallel'.'Eligible' -eq $true))) { $config.'parallel'.'Calculated' = $false - } elseif (($config.'parallel'.'Override'.'value' -eq $false) -And (($config.'parallel'.'Eligible'.'value' -eq $true))) { + } elseif (($config.'parallel'.'Override'.'value' -eq $false) -and (($config.'parallel'.'Eligible'.'value' -eq $true))) { $config.'parallel'.'Calculated'.'value' = $true } else { $config.'parallel'.'Calculated'.'value' = $false } + + # Set the env variable for JCEnvironment + $env:JCEnvironment = $config.'JCEnvironment'.'Location'.value + $global:JCEnvironment = $env:JCEnvironment } end { From bc66aadae57de5c45bd21e1ecb7937dc7d091abd Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 13:36:21 -0700 Subject: [PATCH 17/47] Use global scope for PSDefaultParameterValues Updated Connect-JCOnline.ps1 to set PSDefaultParameterValues in the global scope for API and Console hosts. Also switched to using $env:JCEnvironment in the environment switch statement for consistency. --- .../Authentication/Connect-JCOnline.ps1 | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index f97e06375..fa51c60fc 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -91,28 +91,25 @@ function Connect-JCOnline () { $global:JCEnvironment = $env:JCEnvironment # Set-JCSettingsFile -JCEnvironmentLocation $JCEnvironment } - # if ($JCConfig.JCEnvironment.Location -ne 'STANDARD') { - # $JCEnvironment = $JCConfig.JCEnvironment.Location - # } - switch ($JCEnvironment) { + + switch ($env:JCEnvironment) { 'STANDARD' { $global:JCUrlBasePath = "https://console.jumpcloud.com" - $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" - $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" + $global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" + $global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" } 'staging' { $global:JCUrlBasePath = "https://console.awsstg.jumpcloud.com" - } 'EU' { $global:JCUrlBasePath = "https://console.eu.jumpcloud.com" - $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.eu" - $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.eu" + $global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.eu" + $global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.eu" } default { $global:JCUrlBasePath = "https://console.jumpcloud.com" - $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" - $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" + $global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" + $global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" } } # If "$JumpCloudApiKey" is populated set $env:JCApiKey @@ -241,4 +238,4 @@ function Connect-JCOnline () { } end { } -} +} \ No newline at end of file From d8eb63b2147c071de66f780ee9101276b8561e9c Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 13:36:30 -0700 Subject: [PATCH 18/47] Update JCEnvironment variable assignment logic Refactored environment variable assignment to prioritize JCConfig.JCEnvironment.Location when not 'STANDARD'. Added fallback logic for setting JCEnvironment to 'STANDARD' if no value is provided, improving reliability and clarity in environment configuration. --- .../Public/Authentication/Connect-JCOnline.ps1 | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index fa51c60fc..feca6c0d5 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -85,11 +85,19 @@ function Connect-JCOnline () { try { #Region Set environment variables that can be used by other scripts # If "$JCEnvironment" is populated or if "$env:JCEnvironment" is not set - if (-not [System.String]::IsNullOrEmpty($JCEnvironment)) { - # Set $env:JCEnvironment - $env:JCEnvironment = $JCEnvironment + if ($JCConfig.JCEnvironment.Location -ne 'STANDARD') { + $env:JCEnvironment = $JCConfig.JCEnvironment.Location $global:JCEnvironment = $env:JCEnvironment - # Set-JCSettingsFile -JCEnvironmentLocation $JCEnvironment + } else { + if (-not [System.String]::IsNullOrEmpty($JCEnvironment)) { + # Set $env:JCEnvironment + $env:JCEnvironment = $JCEnvironment + $global:JCEnvironment = $env:JCEnvironment + Set-JCSettingsFile -JCEnvironmentLocation $JCEnvironment + } else { + $env:JCEnvironment = 'STANDARD' + $global:JCEnvironment = $env:JCEnvironment + } } switch ($env:JCEnvironment) { From c9fa70475607fb9267183de4f810af051e542c24 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 13:37:33 -0700 Subject: [PATCH 19/47] Update Set-JCSettingsFile.Tests.ps1 --- .../Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 index 3250e450b..badff6d90 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 @@ -20,6 +20,7 @@ Describe -Tag "JCSettingsFile" -Name "Set JCSettings Tests" { # Check that the setting was modified $oldConfig.parallel.override | Should -Not -Be $modifiedConfig.parallel.override $oldConfig.JCEnvironment.location | Should -Not -Be $modifiedConfig.JCEnvironment.location + $env:JCEnvironment | Should -Be $modifiedConfig.JCEnvironment.location # Get last modified date, this should be different from the file at the start of the test $lastModifiedDate = (Get-Item "$PSScriptRoot\..\..\..\Config.json").LastWriteTime # Test that new config file is actually modified From c09bfbeed398256d807c507426814a40ef1784e9 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 14:01:14 -0700 Subject: [PATCH 20/47] Add EU API key and org ID to CI workflow Introduces PESTER_EU_APIKEY and PESTER_EU_ORGID as environment variables in the PowerShell module CI workflow. These are set as global variables for use in the CI process, supporting EU-specific testing or deployment. --- .github/workflows/powershell-module-ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/powershell-module-ci.yml b/.github/workflows/powershell-module-ci.yml index 7734f2702..1c430c6d0 100644 --- a/.github/workflows/powershell-module-ci.yml +++ b/.github/workflows/powershell-module-ci.yml @@ -194,6 +194,8 @@ jobs: PESTER_APIKEY: ${{ secrets.PESTER_APIKEY }} PESTER_ORGID: ${{ secrets.PESTER_ORGID }} PESTER_MSP_APIKEY: ${{ secrets.PESTER_MSP_APIKEY }} + PESTER_EU_APIKEY: ${{ secrets.PESTER_EU_APIKEY }} + PESTER_EU_ORGID: ${{ secrets.PESTER_EU_ORGID }} run: | # Setup Variables for Pester Run $env:job_group = ${{ matrix.job_group }} @@ -206,7 +208,8 @@ jobs: } } Set-Variable -Name PesterParams_ApiKey -Value "$env:PESTER_APIKEY" -Scope Global - + Set-Variable -Name PesterParams_EU_ApiKey -Value "$env:PESTER_EU_APIKEY" -Scope Global + Set-Variable -Name PesterParams_EU_OrgID -Value "$env:PESTER_EU_ORGID" -Scope Global # Import JC Module Import-Module "${{github.workspace}}/PowerShell/JumpCloud Module/JumpCloud.psd1" From e5a73d1399c9bf6300ee616b9cd324e4275d9b82 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 14:01:31 -0700 Subject: [PATCH 21/47] Add EU org connection tests Introduced a new test context for EU organization scenarios, verifying connection using EU-specific API key and Org ID parameters. Also standardized conditional statements to use lowercase 'if', 'elseif', and 'else' for consistency. --- .../Authentication/Connect-JCOnline.Tests.ps1 | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 index 9013abeb5..902dab271 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 @@ -1,12 +1,26 @@ Describe -Tag:('JCOnline') 'Connect-JCOnline Tests' { BeforeAll { - $StartingApiKey = If (-not [System.String]::IsNullOrEmpty($env:JCApiKey)) { + $StartingApiKey = if (-not [System.String]::IsNullOrEmpty($env:JCApiKey)) { $env:JCApiKey } - $StartingOrgId = If (-not [System.String]::IsNullOrEmpty($env:JCOrgId)) { + $StartingOrgId = if (-not [System.String]::IsNullOrEmpty($env:JCOrgId)) { $env:JCOrgId } } + Context 'EU Org Tests' { + It ('Should connect using the EU JumpCloudApiKey and JumpCloudOrgId parameters.') { + $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_EU_ApiKey) -JumpCloudOrgId:($PesterParams_EU_OrgID) -force + $PesterParams_EU_ApiKey | Should -Be $env:JCApiKey + $PesterParams_EU_OrgID | Should -Be $env:JCOrgId + + $env:JCEnvironment | Should -Be 'EU' + + $global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] | Should -Be "api.eu" + $global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] | Should -Be "console.eu" + # $Connect.JCOrgId | Should -Be $env:JCOrgId + # $Connect.JCOrgId | Should -Be $PesterParams_EU_Org.OrgID + } + } Context 'Single Org Tests' { It ('Should connect using the JumpCloudApiKey and JumpCloudOrgId parameters.') { $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org.OrgID) -force @@ -44,13 +58,13 @@ Describe -Tag:('JCOnline') 'Connect-JCOnline Tests' { } } AfterAll { - If (-not [System.String]::IsNullOrEmpty($StartingApiKey) -and -not [System.String]::IsNullOrEmpty($StartingOrgId)) { + if (-not [System.String]::IsNullOrEmpty($StartingApiKey) -and -not [System.String]::IsNullOrEmpty($StartingOrgId)) { Connect-JCOnline -JumpCloudApiKey:($StartingApiKey) -JumpCloudOrgId:($StartingOrgId) -force | Out-Null - } ElseIf (-not [System.String]::IsNullOrEmpty($StartingApiKey) -and [System.String]::IsNullOrEmpty($StartingOrgId)) { + } elseif (-not [System.String]::IsNullOrEmpty($StartingApiKey) -and [System.String]::IsNullOrEmpty($StartingOrgId)) { Connect-JCOnline -JumpCloudApiKey:($StartingApiKey) -force | Out-Null - } ElseIf ([System.String]::IsNullOrEmpty($StartingApiKey) -and -not [System.String]::IsNullOrEmpty($StartingOrgId)) { + } elseif ([System.String]::IsNullOrEmpty($StartingApiKey) -and -not [System.String]::IsNullOrEmpty($StartingOrgId)) { Connect-JCOnline -JumpCloudOrgId:($StartingOrgId) -force | Out-Null - } Else { + } else { Write-Error ('Unknown scenario encountered') } } From d25e60f172e573228c8b7bb6353a008f9f230035 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 14:09:34 -0700 Subject: [PATCH 22/47] use $global:JCUrlBasePath --- .../Private/NestedFunctions/Invoke-JCApi.ps1 | 116 +++++++++--------- .../Get-JCPolicyTemplateConfigField.ps1 | 4 +- .../Public/Administrators/Get-JCAdmin.ps1 | 2 +- .../Authentication/Set-JCOrganization.ps1 | 60 ++++----- .../Public/Policies/New-JCPolicy.ps1 | 18 +-- .../Get-JCPolicyGroupTemplateMember.ps1 | 6 +- .../PolicyGroups/Remove-JCPolicyGroup.ps1 | 8 +- .../PolicyGroups/Set-JCPolicyGroup.ps1 | 4 +- .../Public/Policies/Set-JCPolicy.ps1 | 26 ++-- .../CSV_Import/Import-JCMSPFromCSV.ps1 | 14 +-- .../CSV_Import/New-JCMSPImportTemplate.ps1 | 28 ++--- .../CSV_Import/Update-JCMSPFromCSV.ps1 | 16 +-- 12 files changed, 151 insertions(+), 151 deletions(-) diff --git a/PowerShell/JumpCloud Module/Private/NestedFunctions/Invoke-JCApi.ps1 b/PowerShell/JumpCloud Module/Private/NestedFunctions/Invoke-JCApi.ps1 index dcd14f6a6..62cb5a733 100755 --- a/PowerShell/JumpCloud Module/Private/NestedFunctions/Invoke-JCApi.ps1 +++ b/PowerShell/JumpCloud Module/Private/NestedFunctions/Invoke-JCApi.ps1 @@ -1,6 +1,6 @@ -Function Invoke-JCApi { +function Invoke-JCApi { [CmdletBinding()] - Param( + param( [Parameter(Mandatory = $true, Position = 0)][ValidateNotNullOrEmpty()][string]$Url, [Parameter(Mandatory = $true, Position = 1)][ValidateNotNullOrEmpty()][string]$Method, [Parameter(Mandatory = $false, Position = 2)][ValidateNotNullOrEmpty()][ValidateRange(1, [int]::MaxValue)][int]$Limit = 100, @@ -10,15 +10,15 @@ Function Invoke-JCApi { [Parameter(Mandatory = $false, Position = 6)][ValidateNotNullOrEmpty()][bool]$Paginate = $false, [Parameter(Mandatory = $false, Position = 7)][ValidateNotNullOrEmpty()][switch]$ReturnCount ) - Begin { + begin { # Debug message for parameter call $PSBoundParameters | Out-DebugParameter | Write-Debug # Populate $env:JCApiKey if its not set - If ([System.String]::IsNullOrEmpty($env:JCApiKey)) { + if ([System.String]::IsNullOrEmpty($env:JCApiKey)) { Connect-JCOnline -force | Out-Null } # Populate $env:JCOrgId if its not set - If (-not [System.String]::IsNullOrEmpty($env:JCApiKey) -and [System.String]::IsNullOrEmpty($env:JCOrgId) -and $Url -notlike '*/api/organizations*') { + if (-not [System.String]::IsNullOrEmpty($env:JCApiKey) -and [System.String]::IsNullOrEmpty($env:JCOrgId) -and $Url -notlike '*/api/organizations*') { Set-JCOrganization -JumpCloudAPIKey:($env:JCApiKey) | Out-Null } #Set JC headers @@ -30,155 +30,155 @@ Function Invoke-JCApi { } # TODO: CUT-4439 need a dynamic list of endpoints that do not accept x-org-id # Organizations endpoint does not accept x-org-id in header - If ( + if ( ($Url -like '*/api/organizations*') -or ($URL -like "*/api/v2/providers/*") -or ($URL -like "*/api/v2/organizations/*")) { $Headers.Remove('x-org-id') | Out-Null } } - Process { - Try { + process { + try { $Results = @() - If ([System.String]::IsNullOrEmpty($JCUrlBasePath)) { - $JCUrlBasePath = 'https://console.jumpcloud.com' - } - If ($Url -notlike ('*' + $JCUrlBasePath + '*')) { + # If ([System.String]::IsNullOrEmpty($JCUrlBasePath)) { + # $JCUrlBasePath = 'https://console.jumpcloud.com' + # } + if ($Url -notlike ('*' + $JCUrlBasePath + '*')) { $Url = $JCUrlBasePath + $Url } - If ($Url -like '*`?*') { + if ($Url -like '*`?*') { $SearchOperator = '&' - } Else { + } else { $SearchOperator = '?' } # Convert passed in body to json - If ($Body) { + if ($Body) { $ObjectBody = $Body | ConvertFrom-Json - } Else { + } else { $ObjectBody = '' } # Pagination - Do { + do { $QueryStrings = @() # Add fields - If ($Fields) { + if ($Fields) { $JoinedFields = ($Fields -join ' ') - If ($ObjectBody.PSObject.Properties.name -eq 'fields') { + if ($ObjectBody.PSObject.Properties.name -eq 'fields') { $JoinedFields = $ObjectBody.fields - } Else { + } else { $ObjectBody = $ObjectBody | Select-Object *, @{Name = 'fields'; Expression = { $JoinedFields } } } - If ($Url -notlike '*fields*') { $QueryStrings += 'fields=' + $JoinedFields } + if ($Url -notlike '*fields*') { $QueryStrings += 'fields=' + $JoinedFields } } # Add limit - If ($ObjectBody.PSObject.Properties.name -eq 'limit') { + if ($ObjectBody.PSObject.Properties.name -eq 'limit') { $ObjectBody.limit = $Limit - } Else { + } else { $ObjectBody = $ObjectBody | Select-Object *, @{Name = 'limit'; Expression = { $Limit } } } - If ($Url -notlike '*limit*') { $QueryStrings += 'limit=' + $Limit } + if ($Url -notlike '*limit*') { $QueryStrings += 'limit=' + $Limit } # Add skip - If ($ObjectBody.PSObject.Properties.name -eq 'skip') { + if ($ObjectBody.PSObject.Properties.name -eq 'skip') { $ObjectBody.skip = $Skip - } Else { + } else { $ObjectBody = $ObjectBody | Select-Object *, @{Name = 'skip'; Expression = { $Skip } } } - If ($Url -notlike '*skip*') { $QueryStrings += 'skip=' + $Skip } + if ($Url -notlike '*skip*') { $QueryStrings += 'skip=' + $Skip } # Build url query string and body $ObjectBody = $ObjectBody | Select-Object -Property * -ExcludeProperty Length $Body = $ObjectBody | ConvertTo-Json -Depth:(10) -Compress | Sort-Object - If ($QueryStrings) { + if ($QueryStrings) { $Uri = $Url + $SearchOperator + (($QueryStrings | Sort-Object) -join '&') - } Else { + } else { $Uri = $Url } # Run request $UserAgent = Get-JCUserAgent Write-Verbose ('Connecting to: ' + $Uri) # PowerShell 5 won't let you send a GET with a body. - If ($Method -eq 'GET') { + if ($Method -eq 'GET') { Write-Debug("[CallFunction]: Invoke-WebRequest -Method:('$Method') -Headers:(@" + ($Headers | ConvertTo-Json -Compress).Replace(':', '=').Replace(',', ';') + ") -Uri:('$Uri') -UseBasicParsing -UserAgent:('$UserAgent')") $RequestResult = Invoke-WebRequest -Method:($Method) -Headers:($Headers) -Uri:($Uri) -UserAgent:($UserAgent) -UseBasicParsing - } Else { + } else { Write-Debug("[CallFunction]: Invoke-WebRequest -Method:('$Method') -Headers:(@" + ($Headers | ConvertTo-Json -Compress).Replace(':', '=').Replace(',', ';') + ") -Uri:('$Uri') -UseBasicParsing -UserAgent:('$UserAgent') -Body:('$Body')") $RequestResult = Invoke-WebRequest -Method:($Method) -Headers:($Headers) -Uri:($Uri) -UserAgent:($UserAgent) -Body:($Body) -UseBasicParsing } - If ($RequestResult) { + if ($RequestResult) { $Result = $RequestResult.Content | ConvertFrom-Json $httpMetaData = $RequestResult | Select-Object -Property:('*') -ExcludeProperty:('Content') - If ($Result) { + if ($Result) { $ResultPopulated = $false # Specific logic for v1 and v2 api specs - If ($Url -like '*/api/*' -and ($Url -notlike '*/api/v2/*' -and $Result.PSObject.Properties.name -eq 'results')) { + if ($Url -like '*/api/*' -and ($Url -notlike '*/api/v2/*' -and $Result.PSObject.Properties.name -eq 'results')) { $ResultCount = ($Result.results | Measure-Object).Count - If ($ResultCount -gt 0) { + if ($ResultCount -gt 0) { $ResultPopulated = $true - If ($ReturnCount) { + if ($ReturnCount) { $ResultObjects = $Result $Paginate = $false - } Else { + } else { $ResultObjects = $Result.results } } - } ElseIf ($Url -like '*/api/*' -and ($Url -like '*/api/v2/*' -or $Result.PSObject.Properties.name -ne 'results')) { + } elseif ($Url -like '*/api/*' -and ($Url -like '*/api/v2/*' -or $Result.PSObject.Properties.name -ne 'results')) { $ResultCount = ($Result | Measure-Object).Count - If ($ResultCount -gt 0) { + if ($ResultCount -gt 0) { $ResultPopulated = $true - If ($ReturnCount) { + if ($ReturnCount) { $ResultObjects = [PSCustomObject]@{'totalCount' = [int](($httpMetaData.Headers.'X-Total-Count') -join ','); 'results' = $Result; } $Paginate = $false - } Else { + } else { $ResultObjects = $Result } } - } Else { + } else { Write-Error ('Url is not a valid JumpCloud V1 or V2 endpoint') } - If ($ResultPopulated -eq $true) { + if ($ResultPopulated -eq $true) { $Skip += $ResultCount $Results += $ResultObjects } - } Else { - If ($Paginate) { + } else { + if ($Paginate) { $ResultCount = ($Result | Measure-Object).Count } } } Write-Debug ('Paginate:' + [string]$Paginate + ';ResultsCount:' + [string]$ResultCount + ';Limit:' + [string]$Limit + ';') } - While ($Paginate -and $ResultCount -eq $Limit) + while ($Paginate -and $ResultCount -eq $Limit) Write-Verbose ('Returned ' + [string]($Results | Measure-Object).Count + ' total results.') - } Catch { + } catch { Invoke-Command -ScriptBlock:($ScriptBlock_TryCatchError) -ArgumentList:($_, $true) -NoNewScope } } - End { + end { # List values to add to results $HiddenProperties = @('httpMetaData') # Validate that all fields passed into the function exist in the output - If ($Results) { + if ($Results) { # Append meta info to each result record Get-Variable -Name:($HiddenProperties) | - ForEach-Object { - $Variable = $_ - $Results | ForEach-Object { - Add-Member -InputObject:($_) -MemberType:('NoteProperty') -Name:($Variable.Name) -Value:($Variable.Value) - } - } + $Variable = $_ + $Results | + ForEach-Object { + Add-Member -InputObject:($_) -MemberType:('NoteProperty') -Name:($Variable.Name) -Value:($Variable.Value) + } + } # Validate results properties returned $Fields | ForEach-Object { - If ($_ -notin ($Results | ForEach-Object { $_.PSObject.Properties.Name } | Select-Object -Unique)) { + if ($_ -notin ($Results | ForEach-Object { $_.PSObject.Properties.Name } | Select-Object -Unique)) { Write-Warning ('API output does not contain the field "' + $_ + '". Please refer to https://docs.jumpcloud.com for API endpoint field names.') } } - } Else { + } else { $Results += [PSCustomObject]@{ 'NoContent' = $null; 'httpMetaData' = $httpMetaData; } } # Set the meta info to be hidden by default - Return Hide-ObjectProperty -Object:($Results) -HiddenProperties:($HiddenProperties) + return Hide-ObjectProperty -Object:($Results) -HiddenProperties:($HiddenProperties) } } diff --git a/PowerShell/JumpCloud Module/Private/Policies/Get-JCPolicyTemplateConfigField.ps1 b/PowerShell/JumpCloud Module/Private/Policies/Get-JCPolicyTemplateConfigField.ps1 index 5ec3640bc..ac44b58d4 100644 --- a/PowerShell/JumpCloud Module/Private/Policies/Get-JCPolicyTemplateConfigField.ps1 +++ b/PowerShell/JumpCloud Module/Private/Policies/Get-JCPolicyTemplateConfigField.ps1 @@ -10,7 +10,7 @@ function Get-JCPolicyTemplateConfigField { $headers = @{} $headers.Add("x-api-key", $env:JCApiKey) $headers.Add("x-org-id", $env:JCOrgId) - $template = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/v2/policytemplates/$templateID" -Method GET -Headers $headers + $template = Invoke-RestMethod -Uri "$global:JCUrlBasePath/api/v2/policytemplates/$templateID" -Method GET -Headers $headers # define policy config field mapping $PolicyConfigMapping = @{ checkbox = 'boolean' @@ -71,7 +71,7 @@ function Get-JCPolicyTemplateConfigField { value = $null defaultValue = $field.defaultValue } - $objectMap.Add($templateObject) | out-null + $objectMap.Add($templateObject) | Out-Null } # Build object to return, including template displayname $templateObject = [PSCustomObject]@{ diff --git a/PowerShell/JumpCloud Module/Public/Administrators/Get-JCAdmin.ps1 b/PowerShell/JumpCloud Module/Public/Administrators/Get-JCAdmin.ps1 index 9d54f5c5e..fa600760b 100644 --- a/PowerShell/JumpCloud Module/Public/Administrators/Get-JCAdmin.ps1 +++ b/PowerShell/JumpCloud Module/Public/Administrators/Get-JCAdmin.ps1 @@ -53,7 +53,7 @@ function Get-JCAdmin { $orgId = $_.orgId $headers.Add("x-org-id", $orgId) - $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/users' -Method GET -Headers $headers + $response = Invoke-RestMethod -Uri "$global:JCUrlBasePath/api/users" -Method GET -Headers $headers # For some reason an admin's organization is not set, manually set $response.results | ForEach-Object { diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Set-JCOrganization.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Set-JCOrganization.ps1 index f85889861..b5e12c584 100644 --- a/PowerShell/JumpCloud Module/Public/Authentication/Set-JCOrganization.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Set-JCOrganization.ps1 @@ -1,54 +1,54 @@ -Function Set-JCOrganization { +function Set-JCOrganization { [CmdletBinding()] - Param( + param( [Parameter(HelpMessage = 'Please enter your JumpCloud API key. This can be found in the JumpCloud admin console within "API Settings" accessible from the drop down icon next to the admin email address in the top right corner of the JumpCloud admin console.')][ValidateNotNullOrEmpty()][System.String]$JumpCloudApiKey = $env:JCApiKey , [Parameter(HelpMessage = 'Organization Id can be found in the Settings page within the admin console. Only needed for multi tenant admins.')][ValidateNotNullOrEmpty()][System.String]$JumpCloudOrgId = $env:JCOrgId ) - Begin { + begin { # Debug message for parameter call $PSBoundParameters | Out-DebugParameter | Write-Debug } - Process { + process { # Load color scheme $JCColorConfig = Get-JCColorConfig # If "$JumpCloudOrgId" is populated set $env:JCOrgId - If (-not [System.String]::IsNullOrEmpty($JumpCloudOrgId)) { + if (-not [System.String]::IsNullOrEmpty($JumpCloudOrgId)) { $env:JCOrgId = $JumpCloudOrgId $global:JCOrgId = $env:JCOrgId } # Set $env:JCApiKey in Connect-JCOnline - If ([System.String]::IsNullOrEmpty($JumpCloudApiKey) -and [System.String]::IsNullOrEmpty($env:JCApiKey)) { + if ([System.String]::IsNullOrEmpty($JumpCloudApiKey) -and [System.String]::IsNullOrEmpty($env:JCApiKey)) { Connect-JCOnline - } ElseIf ((-not [System.String]::IsNullOrEmpty($JumpCloudApiKey) -and [System.String]::IsNullOrEmpty($env:JCApiKey))) { + } elseif ((-not [System.String]::IsNullOrEmpty($JumpCloudApiKey) -and [System.String]::IsNullOrEmpty($env:JCApiKey))) { Connect-JCOnline -JumpCloudApiKey:($JumpCloudApiKey) - } ElseIf ([System.String]::IsNullOrEmpty($JumpCloudApiKey) -and -not [System.String]::IsNullOrEmpty($env:JCApiKey)) { + } elseif ([System.String]::IsNullOrEmpty($JumpCloudApiKey) -and -not [System.String]::IsNullOrEmpty($env:JCApiKey)) { Connect-JCOnline -JumpCloudApiKey:($env:JCApiKey) - } ElseIf ((-not [System.String]::IsNullOrEmpty($JumpCloudApiKey) -and -not [System.String]::IsNullOrEmpty($env:JCApiKey)) -and $JumpCloudApiKey -ne $env:JCApiKey) { + } elseif ((-not [System.String]::IsNullOrEmpty($JumpCloudApiKey) -and -not [System.String]::IsNullOrEmpty($env:JCApiKey)) -and $JumpCloudApiKey -ne $env:JCApiKey) { Connect-JCOnline -JumpCloudApiKey:($JumpCloudApiKey) - } Else { + } else { # Auth has been verified } - If ((-not [System.String]::IsNullOrEmpty($JumpCloudApiKey) -and -not [System.String]::IsNullOrEmpty($env:JCApiKey)) -and $JumpCloudApiKey -eq $env:JCApiKey) { + if ((-not [System.String]::IsNullOrEmpty($JumpCloudApiKey) -and -not [System.String]::IsNullOrEmpty($env:JCApiKey)) -and $JumpCloudApiKey -eq $env:JCApiKey) { Write-Verbose ("Parameter Set: $($PSCmdlet.ParameterSetName)") Write-Verbose ('Populating JCOrganizations') try { $Organizations = Get-JCObject -Type:('organization') -Fields:('_id', 'displayName') -ErrorVariable api_err } catch { - Throw + throw } - If (-not [System.String]::IsNullOrEmpty($Organizations)) { - If ($Organizations.Count -gt 1) { + if (-not [System.String]::IsNullOrEmpty($Organizations)) { + if ($Organizations.Count -gt 1) { # Set the JCProviderID $JCProviderHeaders = @{ 'x-api-key' = $env:JCApiKey } - $ProviderResponse = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/users/getSelf?fields=provider' -Method GET -Headers $JCProviderHeaders - If ($ProviderResponse) { + $ProviderResponse = Invoke-RestMethod -Uri "$global:JCUrlBasePath/api/users/getSelf?fields=provider" -Method GET -Headers $JCProviderHeaders + if ($ProviderResponse) { $env:JCProviderId = $ProviderResponse.provider } # If not JumpCloudOrgId was specified or if the specified JumpCloudOrgId does not exist within the list of available organizations prompt for selection - If ([System.String]::IsNullOrEmpty($JumpCloudOrgId) -or $JumpCloudOrgId -notin $Organizations._id) { + if ([System.String]::IsNullOrEmpty($JumpCloudOrgId) -or $JumpCloudOrgId -notin $Organizations._id) { $OrgIdHash = [ordered]@{ } $OrgNameHash = [ordered]@{ } # Build user menu @@ -58,10 +58,10 @@ Function Set-JCOrganization { [Int32]$menuNumber = 1 Write-Host ('======= JumpCloud Multi Tenant Selector =======') -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Header) Write-Host ($MenuItemTemplate -f ' ', 'JCOrgName', 'JCOrgId') -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Action) - ForEach ($Org In $Organizations) { - $FormattedMenuNumber = If (([System.String]$menuNumber).Length -eq 1) { + foreach ($Org in $Organizations) { + $FormattedMenuNumber = if (([System.String]$menuNumber).Length -eq 1) { ' ' + [System.String]$menuNumber - } Else { + } else { [System.String]$menuNumber } Write-Host ($MenuItemTemplate -f ($FormattedMenuNumber + '.' ), $Org.displayName, $Org._id) -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_Body) @@ -70,39 +70,39 @@ Function Set-JCOrganization { $menuNumber++ } # Prompt user for org selection - Do { + do { Write-Host ('Select JumpCloud tenant you wish to connect to. Enter a value between 1 and ' + [System.String]$OrgIdHash.Count + ':') -BackgroundColor:($JCColorConfig.BackgroundColor) -ForegroundColor:($JCColorConfig.ForegroundColor_UserPrompt) -NoNewline - Write-Host (' ') -NoNewLine + Write-Host (' ') -NoNewline [Int32]$UserSelection = Read-Host } - Until ($UserSelection -le $OrgIdHash.Count) + until ($UserSelection -le $OrgIdHash.Count) $OrgId = $($OrgIdHash.$UserSelection) $OrgName = $($OrgNameHash.$UserSelection) - } Else { + } else { $OrgId = ($Organizations | Where-Object { $_._id -eq $JumpCloudOrgId })._id $OrgName = ($Organizations | Where-Object { $_._id -eq $JumpCloudOrgId }).displayName } - } Else { + } else { $OrgId = $($Organizations._id) $OrgName = $($Organizations.displayName) } - If (-not ([System.String]::IsNullOrEmpty($OrgId))) { + if (-not ([System.String]::IsNullOrEmpty($OrgId))) { $env:JCOrgId = $OrgId $global:JCOrgId = $env:JCOrgId $env:JCOrgName = $OrgName - Return [PSCustomObject]@{ + return [PSCustomObject]@{ # 'JCApiKey' = $env:JCApiKey; 'JCOrgId' = $env:JCOrgId; 'JCOrgName' = $env:JCOrgName; } - } Else { + } else { Write-Error ('OrgId has not been set.') } - } Else { + } else { Write-Error ('Unable to get organization info.') } } } - End { + end { } } diff --git a/PowerShell/JumpCloud Module/Public/Policies/New-JCPolicy.ps1 b/PowerShell/JumpCloud Module/Public/Policies/New-JCPolicy.ps1 index 0c580f579..84bcb89e3 100644 --- a/PowerShell/JumpCloud Module/Public/Policies/New-JCPolicy.ps1 +++ b/PowerShell/JumpCloud Module/Public/Policies/New-JCPolicy.ps1 @@ -25,7 +25,7 @@ function New-JCPolicy { [System.String] $Notes ) - DynamicParam { + dynamicparam { if ($PSBoundParameters["TemplateID"]) { $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute $ParameterAttribute.Mandatory = $false @@ -52,7 +52,7 @@ function New-JCPolicy { } } - if ($templateObject.objectMap -And ($PSBoundParameters["TemplateName"] -OR $PSBoundParameters["TemplateID"])) { + if ($templateObject.objectMap -and ($PSBoundParameters["TemplateName"] -or $PSBoundParameters["TemplateID"])) { $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary # Foreach key in the supplied config file: foreach ($key in $templateObject.objectMap) { @@ -85,12 +85,12 @@ function New-JCPolicy { $paramType = [system.object[]] } 'exclude' { - Continue + continue } 'multilist' { $paramType = [system.object[]] } - Default { + default { $paramType = 'string' } } @@ -132,7 +132,7 @@ function New-JCPolicy { $requiredSet = @('TemplateID', 'TemplateName', 'Name' , 'Values') foreach ($parameter in $paramterSet) { $parameterComparison = Compare-Object -ReferenceObject $requiredSet -DifferenceObject $parameter - if ($parameterComparison | Where-Object { ( $_.sideindicator -eq "=>") -And ($_.InputObject -ne "Notes") }) { + if ($parameterComparison | Where-Object { ( $_.sideindicator -eq "=>") -and ($_.InputObject -ne "Notes") }) { $DynamicParamSet = $true break } @@ -198,7 +198,7 @@ function New-JCPolicy { } $RegProperties | ForEach-Object { if ($_.Name -notin $ObjectProperties) { - Throw "Custom Registry Tables require a `"$($_.Name)`" data string. The following data types were found: $($ObjectProperties)" + throw "Custom Registry Tables require a `"$($_.Name)`" data string. The following data types were found: $($ObjectProperties)" } } # reg type validation @@ -298,7 +298,7 @@ function New-JCPolicy { $templateObject.objectMap[$i].value = $keyValue } } - Default { + default { $templateObject.objectMap[$i].value = $($keyValue) } } @@ -335,7 +335,7 @@ function New-JCPolicy { # User selects edit individual field elseif ($initialUserInput.fieldSelection -ne 'C' -or $initialUserInput.fieldSelection -ne 'A') { $updatedPolicyObject = Set-JCPolicyConfigField -templateObject $templateObject.objectMap -fieldIndex $initialUserInput.fieldSelection - Do { + do { # Hide option to edit all fields $userInput = Show-JCPolicyValues -policyObject $updatedPolicyObject -HideAll $true $updatedPolicyObject = Set-JCPolicyConfigField -templateObject $templateObject.objectMap -fieldIndex $userInput.fieldSelection @@ -372,7 +372,7 @@ function New-JCPolicy { 'x-org-id' = $env:JCOrgId 'content-type' = "application/json" } - $response = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/v2/policies/" -Method POST -Headers $headers -ContentType 'application/json' -Body $body + $response = Invoke-RestMethod -Uri "$global:JCUrlBasePath/api/v2/policies/" -Method POST -Headers $headers -ContentType 'application/json' -Body $body if ($response) { $response | Add-Member -MemberType NoteProperty -Name "templateID" -Value $response.template.id } diff --git a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroupTemplates/Get-JCPolicyGroupTemplateMember.ps1 b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroupTemplates/Get-JCPolicyGroupTemplateMember.ps1 index ce418a930..536cdfca2 100644 --- a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroupTemplates/Get-JCPolicyGroupTemplateMember.ps1 +++ b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroupTemplates/Get-JCPolicyGroupTemplateMember.ps1 @@ -1,4 +1,4 @@ -Function Get-JCPolicyGroupTemplateMember { +function Get-JCPolicyGroupTemplateMember { [CmdletBinding()] param ( [Parameter( @@ -40,10 +40,10 @@ Function Get-JCPolicyGroupTemplateMember { } catch { throw "Could not find policy group template with name: $name" } - "https://console.jumpcloud.com/api/v2/providers/$ProviderID/policygrouptemplates/$GroupTemplateID/members" + "$global:JCUrlBasePath/api/v2/providers/$ProviderID/policygrouptemplates/$GroupTemplateID/members" } "ById" { - "https://console.jumpcloud.com/api/v2/providers/$ProviderID/policygrouptemplates/$GroupTemplateID/members" + "$global:JCUrlBasePath/api/v2/providers/$ProviderID/policygrouptemplates/$GroupTemplateID/members" } } $response = Invoke-JCApi -Method:('Get') -Paginate:($true) -Url:($URL) diff --git a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.ps1 index e28c25a75..04aeb3152 100644 --- a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.ps1 +++ b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Remove-JCPolicyGroup.ps1 @@ -1,4 +1,4 @@ -Function Remove-JCPolicyGroup { +function Remove-JCPolicyGroup { [CmdletBinding()] param ( [Parameter( @@ -49,9 +49,9 @@ Function Remove-JCPolicyGroup { } } process { - if (-NOT [System.String]::IsNullOrEmpty($PolicyGroupID)) { - $URL = "https://console.jumpcloud.com/api/v2/policygroups/$PolicyGroupID" - if (-NOT $Force) { + if (-not [System.String]::IsNullOrEmpty($PolicyGroupID)) { + $URL = "$global:JCUrlBasePath/api/v2/policygroups/$PolicyGroupID" + if (-not $Force) { Write-Warning "Are you sure you wish to delete policy group: `'$($foundPolicy.Name)`'?" -WarningAction Inquire } try { diff --git a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Set-JCPolicyGroup.ps1 b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Set-JCPolicyGroup.ps1 index 06c190c71..1ad199ab7 100644 --- a/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Set-JCPolicyGroup.ps1 +++ b/PowerShell/JumpCloud Module/Public/Policies/PolicyGroups/Set-JCPolicyGroup.ps1 @@ -1,4 +1,4 @@ -Function Set-JCPolicyGroup { +function Set-JCPolicyGroup { [CmdletBinding()] param ( [Parameter( @@ -56,7 +56,7 @@ Function Set-JCPolicyGroup { $foundPolicyGroup.Description } - $URL = "https://console.jumpcloud.com/api/v2/policygroups/$($foundPolicyGroup.id)" + $URL = "$global:JCUrlBasePath/api/v2/policygroups/$($foundPolicyGroup.id)" $BODY = @{ name = "$NameFromProcess" description = "$DescriptionFromProcess" diff --git a/PowerShell/JumpCloud Module/Public/Policies/Set-JCPolicy.ps1 b/PowerShell/JumpCloud Module/Public/Policies/Set-JCPolicy.ps1 index aea7b3322..5e18474c8 100644 --- a/PowerShell/JumpCloud Module/Public/Policies/Set-JCPolicy.ps1 +++ b/PowerShell/JumpCloud Module/Public/Policies/Set-JCPolicy.ps1 @@ -28,7 +28,7 @@ function Set-JCPolicy { [System.String] $Notes ) - DynamicParam { + dynamicparam { if ($PSBoundParameters["PolicyID"]) { $ParameterAttribute = New-Object System.Management.Automation.ParameterAttribute @@ -57,7 +57,7 @@ function Set-JCPolicy { } } # If policy is identified, get the dynamic policy set - if ($foundPolicy.id -And ($PSBoundParameters["PolicyName"] -OR $PSBoundParameters["PolicyID"])) { + if ($foundPolicy.id -and ($PSBoundParameters["PolicyName"] -or $PSBoundParameters["PolicyID"])) { # Set the policy template object based on policy $templateObject = Get-JCPolicyTemplateConfigField -templateID $foundPolicy.Template.Id $RuntimeParameterDictionary = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary @@ -95,9 +95,9 @@ function Set-JCPolicy { $paramType = [system.object[]] } 'exclude' { - Continue + continue } - Default { + default { $paramType = 'string' } } @@ -145,7 +145,7 @@ function Set-JCPolicy { } process { # Get Existing Policy Data if not set through dynamic param - if (([string]::IsNullOrEmpty($foundPolicy.ID)) -And ($policyID)) { + if (([string]::IsNullOrEmpty($foundPolicy.ID)) -and ($policyID)) { # Get the policy by ID $foundPolicy = Get-JCPolicy -PolicyID $PolicyID if ([string]::IsNullOrEmpty($foundPolicy.ID)) { @@ -168,15 +168,15 @@ function Set-JCPolicy { $requiredSet = @('PolicyID', 'PolicyName', 'NewName' , 'Values') foreach ($parameter in $paramterSet) { $parameterComparison = Compare-Object -ReferenceObject $requiredSet -DifferenceObject $parameter - if ($parameterComparison | Where-Object { ( $_.sideindicator -eq "=>") -And ($_.InputObject -ne "Notes") }) { + if ($parameterComparison | Where-Object { ( $_.sideindicator -eq "=>") -and ($_.InputObject -ne "Notes") }) { $DynamicParamSet = $true break } } # only update newName or Notes: - if ((("NewName" -in $params.keys) -AND ("Values" -notin $params.Keys)) -OR - (("Notes" -in $params.keys) -AND ("Values" -notin $params.Keys))) { + if ((("NewName" -in $params.keys) -and ("Values" -notin $params.Keys)) -or + (("Notes" -in $params.keys) -and ("Values" -notin $params.Keys))) { $Values = $foundPolicy.values } # get the notes if it's not in the param set @@ -233,7 +233,7 @@ function Set-JCPolicy { } $RegProperties | ForEach-Object { if ($_.Name -notin $ObjectProperties) { - Throw "Custom Registry Tables require a `"$($_.Name)`" data string. The following data types were found: $($ObjectProperties)" + throw "Custom Registry Tables require a `"$($_.Name)`" data string. The following data types were found: $($ObjectProperties)" } } # reg type validation @@ -262,7 +262,7 @@ function Set-JCPolicy { } $uriListProperties | ForEach-Object { if ($_.Name -notin $ObjectProperties) { - Throw "Custom Windows MDM Policy require a `"$($_.Name)`" data string. The following data types were found: $($ObjectProperties)" + throw "Custom Windows MDM Policy require a `"$($_.Name)`" data string. The following data types were found: $($ObjectProperties)" } } # uriList type validation @@ -350,7 +350,7 @@ function Set-JCPolicy { $templateObject.objectMap[$i].value = $keyValue } } - Default { + default { $templateObject.objectMap[$i].value = $($keyValue) } } @@ -423,7 +423,7 @@ function Set-JCPolicy { $_ | Add-Member -MemberType NoteProperty -Name "label" -Value $templateObject.objectMap[$templateObject.objectMap.configFieldID.IndexOf($($_.configFieldID))].label } } - Do { + do { # Hide option to edit all fields $userInput = Show-JCPolicyValues -policyObject $updatedPolicyObject -HideAll $true -policyValues $foundPolicy.values $updatedPolicyObject = Set-JCPolicyConfigField -templateObject $templateObject.objectMap -fieldIndex $userInput.fieldSelection -policyValues $foundPolicy.values @@ -451,7 +451,7 @@ function Set-JCPolicy { 'x-org-id' = $env:JCOrgId 'content-type' = "application/json" } - $response = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/v2/policies/$($foundPolicy.id)" -Method PUT -Headers $headers -ContentType 'application/json' -Body $body + $response = Invoke-RestMethod -Uri "$global:JCUrlBasePath/api/v2/policies/$($foundPolicy.id)" -Method PUT -Headers $headers -ContentType 'application/json' -Body $body if ($response) { $response | Add-Member -MemberType NoteProperty -Name "templateID" -Value $response.template.id } diff --git a/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Import-JCMSPFromCSV.ps1 b/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Import-JCMSPFromCSV.ps1 index c150b7c8c..d3c7b9aca 100644 --- a/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Import-JCMSPFromCSV.ps1 +++ b/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Import-JCMSPFromCSV.ps1 @@ -1,4 +1,4 @@ -Function Import-JCMSPFromCSV () { +function Import-JCMSPFromCSV () { [CmdletBinding(DefaultParameterSetName = 'GUI')] param ( @@ -57,7 +57,7 @@ Function Import-JCMSPFromCSV () { $orgDup = $orgNameCheck | Group-Object Name - ForEach ($U in $orgDup) { + foreach ($U in $orgDup) { if ($U.count -gt 1) { Write-Host "Organization: $($U.Name) is duplicated in import file." throw "Duplicate organization name: $($U.Name) in import file. organiztion name already exists." @@ -77,7 +77,7 @@ Function Import-JCMSPFromCSV () { if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { Connect-JCOnline } - if (-Not $Env:JCProviderID) { + if (-not $Env:JCProviderID) { $PID = Read-Host "Please enter your Provider ID" $Env:JCProviderID = $PID } @@ -92,7 +92,7 @@ Function Import-JCMSPFromCSV () { MSP Update "@ - If (!(Get-PSCallStack | Where-Object { $_.Command -match 'Pester' })) { + if (!(Get-PSCallStack | Where-Object { $_.Command -match 'Pester' })) { Clear-Host } } @@ -163,8 +163,8 @@ Function Import-JCMSPFromCSV () { if ($response) { Clear-Variable -Name response } - Try { - $response = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/v2/providers/$($ENV:JCProviderID)/organizations" -Method POST -Headers $headers -ContentType 'application/json' -Body $body -ErrorVariable errMsg + try { + $response = Invoke-RestMethod -Uri "$global:JCUrlBasePath/api/v2/providers/$($ENV:JCProviderID)/organizations" -Method POST -Headers $headers -ContentType 'application/json' -Body $body -ErrorVariable errMsg # Add to result array $ResultsArrayList.Add( [PSCustomObject]@{ @@ -174,7 +174,7 @@ Function Import-JCMSPFromCSV () { 'status' = 'Imported' }) | Out-Null } catch { - If ($errMsg.Message) { + if ($errMsg.Message) { $Status = $errMsg.Message } elseif ($errMsg.ErrorDetails) { $Status = $errMsg.ErrorDetails diff --git a/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/New-JCMSPImportTemplate.ps1 b/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/New-JCMSPImportTemplate.ps1 index a41c51a1d..be6fe1574 100644 --- a/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/New-JCMSPImportTemplate.ps1 +++ b/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/New-JCMSPImportTemplate.ps1 @@ -1,4 +1,4 @@ -Function New-JCMSPImportTemplate() { +function New-JCMSPImportTemplate() { [CmdletBinding()] param @@ -83,7 +83,7 @@ Function New-JCMSPImportTemplate() { $ConfirmUpdateVsNew = 'N' } elseif ($type -eq 'Update') { $ConfirmUpdateVsNew = 'U' - } Else { + } else { # PromptForChoice Args $Title = "Do you want to create an import CSV template for creating new MSP orgs or updating existing MSP orgs?" @@ -130,9 +130,9 @@ Function New-JCMSPImportTemplate() { $skip = 0 $limit = 10 - Do { + do { # get results - $response = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/organizations?limit=$($limit)&skip=$($skip)&sortIgnoreCase=settings.name&fields%5B0%5D=id&fields%5B1%5D=displayName&fields%5B2%5D=systemsCount&fields%5B3%5D=systemUsersCount&fields%5B4%5D=highWaterMarkLastMonth&fields%5B5%5D=entitlement&fields%5B6%5D=maxSystemUsers" -Method GET -Headers $orgHeaders + $response = Invoke-RestMethod -Uri "$global:JCUrlBasePath/api/organizations?limit=$($limit)&skip=$($skip)&sortIgnoreCase=settings.name&fields%5B0%5D=id&fields%5B1%5D=displayName&fields%5B2%5D=systemsCount&fields%5B3%5D=systemUsersCount&fields%5B4%5D=highWaterMarkLastMonth&fields%5B5%5D=entitlement&fields%5B6%5D=maxSystemUsers" -Method GET -Headers $orgHeaders # add results to the ExistingOrgs foreach ($item in $response.results) { @@ -169,24 +169,24 @@ Function New-JCMSPImportTemplate() { if ($PSCmdlet.ParameterSetName -eq 'force') { if (!$ExportPath ) { Write-Host "" - $CSV | Export-Csv -path "$ExportLocation/$FileName" -NoTypeInformation - Write-Host 'Creating file ' -NoNewline + $CSV | Export-Csv -Path "$ExportLocation/$FileName" -NoTypeInformation + Write-Host 'Creating file ' -NoNewline Write-Host $FileName -ForegroundColor Yellow -NoNewline Write-Host ' in the location' -NoNewline Write-Host " $ExportLocation" -ForegroundColor Yellow } else { Write-Warning "The file $fileName already exists, overwriting..." - $CSV | Export-Csv -path "$ExportLocation/$FileName" -NoTypeInformation - Write-Host 'Creating file ' -NoNewline + $CSV | Export-Csv -Path "$ExportLocation/$FileName" -NoTypeInformation + Write-Host 'Creating file ' -NoNewline Write-Host $FileName -ForegroundColor Yellow -NoNewline Write-Host ' in the location' -NoNewline Write-Host " $ExportLocation" -ForegroundColor Yellow } - } Else { + } else { if (!$ExportPath ) { Write-Host "" - $CSV | Export-Csv -path "$ExportLocation/$FileName" -NoTypeInformation - Write-Host 'Creating file' -NoNewline + $CSV | Export-Csv -Path "$ExportLocation/$FileName" -NoTypeInformation + Write-Host 'Creating file' -NoNewline Write-Host " $fileName" -ForegroundColor Yellow -NoNewline Write-Host ' in the location' -NoNewline Write-Host " $ExportLocation" -ForegroundColor Yellow @@ -194,8 +194,8 @@ Function New-JCMSPImportTemplate() { Write-Host "" Write-Warning "The file $fileName already exists do you want to overwrite it?" -WarningAction Inquire Write-Host "" - $CSV | Export-Csv -path "$ExportLocation/$FileName" -NoTypeInformation - Write-Host 'Creating file ' -NoNewline + $CSV | Export-Csv -Path "$ExportLocation/$FileName" -NoTypeInformation + Write-Host 'Creating file ' -NoNewline Write-Host $FileName -ForegroundColor Yellow -NoNewline Write-Host ' in the location' -NoNewline Write-Host " $ExportLocation" -ForegroundColor Yellow @@ -217,7 +217,7 @@ Function New-JCMSPImportTemplate() { # Action based on the choice switch ($Choice) { 0 { - Invoke-Item -path "$ExportLocation/$FileName" + Invoke-Item -Path "$ExportLocation/$FileName" } 1 { $ConfirmUpdateVsNew = 'U' diff --git a/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Update-JCMSPFromCSV.ps1 b/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Update-JCMSPFromCSV.ps1 index c66debe69..b47db39f0 100644 --- a/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Update-JCMSPFromCSV.ps1 +++ b/PowerShell/JumpCloud Module/Public/Utilities/CSV_Import/Update-JCMSPFromCSV.ps1 @@ -1,4 +1,4 @@ -Function Update-JCMSPFromCSV () { +function Update-JCMSPFromCSV () { [CmdletBinding(DefaultParameterSetName = 'GUI')] param ( @@ -61,7 +61,7 @@ Function Update-JCMSPFromCSV () { # check for duplicate orgs $orgDup = $orgNameCheck | Group-Object Name - ForEach ($U in $orgDup) { + foreach ($U in $orgDup) { if ($U.count -gt 1) { Write-Host "Organization: $($U.Name) is duplicated in update file." throw "Duplicate organization name: $($U.Name) in update file. organiztion name already exists." @@ -81,7 +81,7 @@ Function Update-JCMSPFromCSV () { if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { Connect-JCOnline } - if (-Not $Env:JCProviderID) { + if (-not $Env:JCProviderID) { $PID = Read-Host "Please enter your Provider ID" $Env:JCProviderID = $PID } @@ -96,7 +96,7 @@ Function Update-JCMSPFromCSV () { MSP Update "@ - If (!(Get-PSCallStack | Where-Object { $_.Command -match 'Pester' })) { + if (!(Get-PSCallStack | Where-Object { $_.Command -match 'Pester' })) { Clear-Host } } @@ -110,7 +110,7 @@ Function Update-JCMSPFromCSV () { Write-Host $Banner -ForegroundColor Green Write-Host "" - Write-host "Update Summary:" + Write-Host "Update Summary:" $orgNameCheck | Format-Table # PromptForChoice Args @@ -167,8 +167,8 @@ Function Update-JCMSPFromCSV () { if ($response) { Clear-Variable -Name response } - Try { - $response = Invoke-RestMethod -Uri "https://console.jumpcloud.com/api/v2/providers/$($ENV:JCProviderID)/organizations/$($OrgUpdate.id)" -Method PUT -Headers $headers -ContentType 'application/json' -Body $body -ErrorVariable errMsg + try { + $response = Invoke-RestMethod -Uri "$global:JCUrlBasePath/api/v2/providers/$($ENV:JCProviderID)/organizations/$($OrgUpdate.id)" -Method PUT -Headers $headers -ContentType 'application/json' -Body $body -ErrorVariable errMsg # Add to result array $ResultsArrayList.Add( [PSCustomObject]@{ @@ -178,7 +178,7 @@ Function Update-JCMSPFromCSV () { 'status' = 'Updated' }) | Out-Null } catch { - If ($errMsg.Message) { + if ($errMsg.Message) { $Status = $errMsg.Message } elseif ($errMsg.ErrorDetails) { $Status = $errMsg.ErrorDetails From b4e78b8378b0dc76b669a4364773b2343e3e8d1d Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 16:09:10 -0700 Subject: [PATCH 23/47] needs 0.1.1 sdks --- .github/workflows/powershell-module-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/powershell-module-ci.yml b/.github/workflows/powershell-module-ci.yml index 1c430c6d0..193c8dc33 100644 --- a/.github/workflows/powershell-module-ci.yml +++ b/.github/workflows/powershell-module-ci.yml @@ -98,9 +98,9 @@ jobs: 'PlatyPS' = @{Repository = 'PSGallery'; RequiredVersion = '0.14.2' } 'AWS.Tools.Common' = @{Repository = 'PSGallery'; RequiredVersion = '4.1.122' } 'AWS.Tools.CodeArtifact' = @{Repository = 'PSGallery'; RequiredVersion = '4.1.122' } - 'JumpCloud.SDK.V1' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'} - 'JumpCloud.SDK.V2' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'} - 'JumpCloud.SDK.DirectoryInsights' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'} + 'JumpCloud.SDK.V1' = @{Repository = 'PSGallery'; RequiredVersion = '0.1.1'} + 'JumpCloud.SDK.V2' = @{Repository = 'PSGallery'; RequiredVersion = '0.1.1'} + 'JumpCloud.SDK.DirectoryInsights' = @{Repository = 'PSGallery'; RequiredVersion = '0.1.1'} 'powershell-yaml' = @{Repository = 'PSGallery'; RequiredVersion = '0.4.7'} } From caa2a24511278b559cf3a455671bc8ed5fb5930d Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 16:12:08 -0700 Subject: [PATCH 24/47] Refactor and expand JCEnvironment tests Separated JCEnvironment location change tests into a dedicated test case and added assertions for both environment and global variables. This improves clarity and coverage of the Set-JCSettingsFile functionality. --- .../settings/Set-JCSettingsFile.Tests.ps1 | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 index badff6d90..3efee1034 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/settings/Set-JCSettingsFile.Tests.ps1 @@ -10,20 +10,34 @@ Describe -Tag "JCSettingsFile" -Name "Set JCSettings Tests" { } else { Set-JCSettingsFile -parallelOverride $true } - if ($oldConfig.JCEnvironment.location -eq 'STANDARD') { - Set-JCSettingsFile -JCEnvironmentLocation 'EU' - } else { - Set-JCSettingsFile -JCEnvironmentLocation 'STANDARD' - } # Get modified config file: $modifiedConfig = Get-JCSettingsFile # Check that the setting was modified $oldConfig.parallel.override | Should -Not -Be $modifiedConfig.parallel.override - $oldConfig.JCEnvironment.location | Should -Not -Be $modifiedConfig.JCEnvironment.location - $env:JCEnvironment | Should -Be $modifiedConfig.JCEnvironment.location # Get last modified date, this should be different from the file at the start of the test $lastModifiedDate = (Get-Item "$PSScriptRoot\..\..\..\Config.json").LastWriteTime # Test that new config file is actually modified $lastModifiedDate | Should -BeGreaterThan $previousModifiedDate } + + It 'Changes JCEnvironment' { + # Get old config file: + $oldConfig = Get-JCSettingsFile + # Set JCEnvironment to EU + Set-JCSettingsFile -JCEnvironmentLocation 'EU' + # Get modified config file: + $modifiedConfig = Get-JCSettingsFile + # Check that the setting was modified + $oldConfig.JCEnvironment.Location | Should -Not -Be $modifiedConfig.JCEnvironment.Location + $modifiedConfig.JCEnvironment.Location | Should -Be 'EU' + # Check that env variable is set + $env:JCEnvironment | Should -Be 'EU' + $global:JCEnvironment | Should -Be 'EU' + + # Revert changes + Set-JCSettingsFile -JCEnvironmentLocation 'STANDARD' + # Check that env variable is set + $env:JCEnvironment | Should -Be 'STANDARD' + $global:JCEnvironment | Should -Be 'STANDARD' + } } \ No newline at end of file From 8bc744b73c0c9bb6250e7f0f75120ac29ab2ce28 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 16:16:02 -0700 Subject: [PATCH 25/47] Update ModuleChangelog.md --- PowerShell/ModuleChangelog.md | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 5656c5c26..cfe198b20 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,19 @@ +## 2.19.0 + +Release Date: November 24, 2025 + +#### RELEASE NOTES + +``` +Introduced support for EU based organizations with Connect-JCOnline +``` + +#### FEATURES: + +- Introduces the `-JCEnvironment` parameter for `Connect-JCOnline` + - This now allows organizations based in the EU datacenter to run PowerShell commands +- Refactored hardcoded endpoint URLs to use a variable depending on which datacenter the module is connected to + ## 2.18.2 Release Date: September 8, 2025 @@ -10,7 +26,7 @@ Fixed an issue with excluding properties for Update-JCDeviceFromCSV when using P #### BUG FIXES: -* Address a bug impacting Update-JCDeviceFromCSV +- Address a bug impacting Update-JCDeviceFromCSV ## 2.18.1 @@ -24,7 +40,7 @@ Implements fix for errors in module directory path resolution #### BUG FIXES: -* Addresses a bug that impacted module directory paths. +- Addresses a bug that impacted module directory paths. ## 2.18.0 @@ -39,15 +55,17 @@ Introduces the primarySystemUser parameter to Set-JCSystem and Update-JCDeviceFr ``` #### FEATURES: + - Introduces support for passing list of objects (uriList) for Custom MDM (OMA-URI) policy with New/Set-JCPolicy - Dynamic param added `-uriList` - Menu for `Set-JCPolicy` to edit uriList - create/update/add/remove + * Added the primarySystemUser parameter to Set-JCSystem * Update-JCDeviceFromCSV supports the primarySystemUser param that was added to Set-JCSystem #### BUG FIXES: -* Added an Alias of GroupID to the ByID parameter for Get-JCUserGroupMember +- Added an Alias of GroupID to the ByID parameter for Get-JCUserGroupMember ## 2.17.0 From 7d867c6a3a868f6d2442df3b65b61063ead270b7 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 24 Nov 2025 16:19:21 -0700 Subject: [PATCH 26/47] Update JumpCloud.psd1 --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index b52e6eaad..2e480da39 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 9/8/2025 +# Generated on: 11/24/2025 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '2.18.2' +ModuleVersion = '2.19.0' # Supported PSEditions # CompatiblePSEditions = @() From 6ce2f79f5ba70d50356b3ff0f5721a2d3fca471f Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 25 Nov 2025 10:18:05 -0700 Subject: [PATCH 27/47] set env, default param values --- .../Public/Authentication/Connect-JCOnline.ps1 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index feca6c0d5..5ff27d996 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -103,21 +103,25 @@ function Connect-JCOnline () { switch ($env:JCEnvironment) { 'STANDARD' { $global:JCUrlBasePath = "https://console.jumpcloud.com" - $global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" - $global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" +$env:JCEnvironment = 'STANDARD' } 'staging' { $global:JCUrlBasePath = "https://console.awsstg.jumpcloud.com" } 'EU' { +Write-Host "Setting JumpCloud Environment to EU Region" -ForegroundColor Green $global:JCUrlBasePath = "https://console.eu.jumpcloud.com" - $global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.eu" - $global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.eu" + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.eu" + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.eu" +$env:JCEnvironment = 'EU' } default { $global:JCUrlBasePath = "https://console.jumpcloud.com" - $global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" - $global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" +$env:JCEnvironment = 'STANDARD' } } # If "$JumpCloudApiKey" is populated set $env:JCApiKey From 958b38158d27203e746f4bf468c54b6f0c1ccd0e Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 10:30:46 -0700 Subject: [PATCH 28/47] JCEnvironment variable handling Simplifies logic for setting JCEnvironment environment variables and global variables. Removes redundant checks and streamlines assignment, improving code readability and maintainability. --- .../Authentication/Connect-JCOnline.ps1 | 25 +++++++------------ 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 index 5ff27d996..9550f1d2b 100755 --- a/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 +++ b/PowerShell/JumpCloud Module/Public/Authentication/Connect-JCOnline.ps1 @@ -84,20 +84,14 @@ function Connect-JCOnline () { Invoke-Command -ScriptBlock:($ScriptBlock_DefaultDynamicParamProcess) -ArgumentList:($PsBoundParameters, $PSCmdlet, $RuntimeParameterDictionary) -NoNewScope try { #Region Set environment variables that can be used by other scripts - # If "$JCEnvironment" is populated or if "$env:JCEnvironment" is not set - if ($JCConfig.JCEnvironment.Location -ne 'STANDARD') { - $env:JCEnvironment = $JCConfig.JCEnvironment.Location + if ([System.String]::IsNullOrEmpty($JCEnvironment)) { + $env:JCEnvironment = $JCConfig.JCEnvironment.location $global:JCEnvironment = $env:JCEnvironment } else { - if (-not [System.String]::IsNullOrEmpty($JCEnvironment)) { - # Set $env:JCEnvironment - $env:JCEnvironment = $JCEnvironment - $global:JCEnvironment = $env:JCEnvironment - Set-JCSettingsFile -JCEnvironmentLocation $JCEnvironment - } else { - $env:JCEnvironment = 'STANDARD' - $global:JCEnvironment = $env:JCEnvironment - } + # Set $env:JCEnvironment + $env:JCEnvironment = $JCEnvironment + $global:JCEnvironment = $env:JCEnvironment + Set-JCSettingsFile -JCEnvironmentLocation $JCEnvironment } switch ($env:JCEnvironment) { @@ -105,23 +99,22 @@ function Connect-JCOnline () { $global:JCUrlBasePath = "https://console.jumpcloud.com" $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" -$env:JCEnvironment = 'STANDARD' + $env:JCEnvironment = 'STANDARD' } 'staging' { $global:JCUrlBasePath = "https://console.awsstg.jumpcloud.com" } 'EU' { -Write-Host "Setting JumpCloud Environment to EU Region" -ForegroundColor Green $global:JCUrlBasePath = "https://console.eu.jumpcloud.com" $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api.eu" $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console.eu" -$env:JCEnvironment = 'EU' + $env:JCEnvironment = 'EU' } default { $global:JCUrlBasePath = "https://console.jumpcloud.com" $PSDefaultParameterValues['*-JcSdk*:ApiHost'] = "api" $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] = "console" -$env:JCEnvironment = 'STANDARD' + $env:JCEnvironment = 'STANDARD' } } # If "$JumpCloudApiKey" is populated set $env:JCApiKey From 53e0d5ab44fdea8951daed414c6fbb72bf0268e0 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 10:30:59 -0700 Subject: [PATCH 29/47] Set JCUrlBasePath based on JCEnvironment variable Adds logic to set the JumpCloud API base path according to the JCEnvironment environment variable, defaulting to EU or US endpoints as appropriate if JCUrlBasePath is not set. --- .../Private/NestedFunctions/Invoke-JCApi.ps1 | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/Private/NestedFunctions/Invoke-JCApi.ps1 b/PowerShell/JumpCloud Module/Private/NestedFunctions/Invoke-JCApi.ps1 index 62cb5a733..1ce261a86 100755 --- a/PowerShell/JumpCloud Module/Private/NestedFunctions/Invoke-JCApi.ps1 +++ b/PowerShell/JumpCloud Module/Private/NestedFunctions/Invoke-JCApi.ps1 @@ -40,9 +40,13 @@ function Invoke-JCApi { process { try { $Results = @() - # If ([System.String]::IsNullOrEmpty($JCUrlBasePath)) { - # $JCUrlBasePath = 'https://console.jumpcloud.com' - # } + if ([System.String]::IsNullOrEmpty($global:JCUrlBasePath)) { + if ($env:JCEnvironment -eq 'EU') { + $JCUrlBasePath = 'https://console.eu.jumpcloud.com' + } else { + $JCUrlBasePath = 'https://console.jumpcloud.com' + } + } if ($Url -notlike ('*' + $JCUrlBasePath + '*')) { $Url = $JCUrlBasePath + $Url } From 8e849b0b2f31cfb152063efc7686be945ce4cdb3 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 10:32:12 -0700 Subject: [PATCH 30/47] Remove redundant JCAPIKEY check in Set-JCSettingsFile Eliminated the check for JCAPIKEY and the forced Connect-JCOnline call in the begin block of Set-JCSettingsFile, streamlining initialization logic. --- .../JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 | 4 ---- 1 file changed, 4 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 b/PowerShell/JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 index 0fc03bd51..c12093970 100644 --- a/PowerShell/JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 +++ b/PowerShell/JumpCloud Module/Public/settings/Set-JCSettingsFile.ps1 @@ -51,10 +51,6 @@ function Set-JCSettingsFile { } } begin { - if ([System.String]::IsNullOrEmpty($JCAPIKEY)) { - Connect-JCOnline -force | Out-Null - } - # Config should be in /PowerShell/JumpCloudModule/Config.json $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent.FullName $configFilePath = Join-Path -Path $ModuleRoot -ChildPath 'Config.json' From 8ad53a068e4c81f1fc6c1fb35f4c54308949775d Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 10:44:20 -0700 Subject: [PATCH 31/47] exclude Set-JCSettingsFile --- .../Tests/ModuleValidation/FunctionFiles.Tests.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/ModuleValidation/FunctionFiles.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/ModuleValidation/FunctionFiles.Tests.ps1 index 796939d61..4b79b2b59 100755 --- a/PowerShell/JumpCloud Module/Tests/ModuleValidation/FunctionFiles.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/ModuleValidation/FunctionFiles.Tests.ps1 @@ -1,5 +1,5 @@ Describe -Tag:('ModuleValidation') 'Function Format Tests' { - Function Get-FunctionReportTestCases { + function Get-FunctionReportTestCases { $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent.FullName $FunctionList = Get-FunctionReport -Folder:(("$ModuleRoot/Public"), ("$ModuleRoot/Private")) | Where-Object { $_.FileName -notlike 'ScriptBlock_*' } $FunctionListTestCases = $FunctionList | ForEach-Object { @@ -14,7 +14,7 @@ Describe -Tag:('ModuleValidation') 'Function Format Tests' { FullName = $_.FullName } } - Return $FunctionListTestCases; + return $FunctionListTestCases; } Context ('Test that the file name matches the function name') { It ('When FileBaseName "" equal Function "" for file ""') -TestCases:(Get-FunctionReportTestCases) { @@ -37,7 +37,7 @@ Describe -Tag:('ModuleValidation') 'Function Format Tests' { } Context ('Test that Connect-JCOnline exists in each Public function') { It ('When FileName "" does not contain "Connect-JCOnline"') -TestCases:(Get-FunctionReportTestCases) { - If ($FolderLocation -eq 'Public' -and $FileName -notin ('New-JCDeploymentTemplate.ps1', 'Update-JCModule.ps1')) { + if ($FolderLocation -eq 'Public' -and $FileName -notin ('Set-JCSettingsFile.ps1', 'New-JCDeploymentTemplate.ps1', 'Update-JCModule.ps1')) { ($Content | Select-String -Pattern:('(?i)(Connect-JCOnline)')) | Should -Not -BeNullOrEmpty } } @@ -49,7 +49,7 @@ Describe -Tag:('ModuleValidation') 'Function Format Tests' { It ('When multiple functions with the same name exist for ""') -TestCases:(Get-FunctionReportTestCases) { ($Function | Group-Object).Count | Should -Be 1 } - It ('When multiple MatchValues of functions with the same name exist for ""') -TestCases:(Get-FunctionReportTestCases) { + It ('When multiple MatchValues of functions with the same name exist for ""') -TestCases:(Get-FunctionReportTestCases) { ($MatchValue | Group-Object).Count | Should -Be 1 } } From 1e6fe8735dbb37a3e2c27086228e555df96720d0 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 25 Nov 2025 10:55:58 -0700 Subject: [PATCH 32/47] spellcheck --- .github/workflows/powershell-module-ci.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/powershell-module-ci.yml b/.github/workflows/powershell-module-ci.yml index 193c8dc33..81fe8989c 100644 --- a/.github/workflows/powershell-module-ci.yml +++ b/.github/workflows/powershell-module-ci.yml @@ -64,7 +64,7 @@ jobs: run: | # validate release type variables $env:RELEASE_TYPE | Should -BeIn @('major','minor','patch','manual') - Setup-Build-Dependancies: + Setup-Build-Dependencies: needs: ["Filter-Branch", "Check-PR-Labels", "Validate-Env-Variables"] runs-on: ubuntu-latest timeout-minutes: 10 @@ -75,7 +75,7 @@ jobs: uses: actions/cache@v3 with: path: "/home/runner/.local/share/powershell/Modules/" - key: PS-Dependancies + key: PS-Dependencies - name: Install dependencies if: steps.cacher.outputs.cache-hit != 'true' shell: pwsh @@ -116,7 +116,7 @@ jobs: } Validate-Module: - needs: ["Setup-Build-Dependancies", "Check-PR-Labels"] + needs: ["Setup-Build-Dependencies", "Check-PR-Labels"] runs-on: ubuntu-latest timeout-minutes: 10 steps: @@ -128,14 +128,14 @@ jobs: - uses: actions/cache@v3 with: path: "/home/runner/.local/share/powershell/Modules/" - key: PS-Dependancies + key: PS-Dependencies - env: RELEASE_TYPE: ${{ needs.Check-PR-Labels.outputs.RELEASE_TYPE }} shell: pwsh run: | . "./PowerShell/JumpCloud Module/Tests/InvokePester.ps1" -ModuleValidation Setup-Org: - needs: ["Setup-Build-Dependancies", "Check-PR-Labels"] + needs: ["Setup-Build-Dependencies", "Check-PR-Labels"] runs-on: ubuntu-latest name: Setup Org Upload Variable Artifact steps: @@ -147,7 +147,7 @@ jobs: - uses: actions/cache@v3 with: path: "/home/runner/.local/share/powershell/Modules/" - key: PS-Dependancies + key: PS-Dependencies - name: Setup Org Variables shell: pwsh env: @@ -167,7 +167,7 @@ jobs: name: jumpcloud-vars path: /home/runner/.local/share/powershell/Modules/PesterVariables.json Test-Module: - needs: ["Setup-Build-Dependancies", "Check-PR-Labels", "Setup-Org"] + needs: ["Setup-Build-Dependencies", "Check-PR-Labels", "Setup-Org"] runs-on: ubuntu-latest timeout-minutes: 75 strategy: @@ -184,7 +184,7 @@ jobs: - uses: actions/cache@v3 with: path: "/home/runner/.local/share/powershell/Modules/" - key: PS-Dependancies + key: PS-Dependencies - uses: actions/download-artifact@v4 with: name: jumpcloud-vars @@ -219,7 +219,7 @@ jobs: # Invoke Pester . "./PowerShell/JumpCloud Module/Tests/InvokePester.ps1" -JumpCloudApiKey "$env:PESTER_APIKEY" -ExcludeTagList "ModuleValidation", "JCDeployment", "MSP", "JCModule" -IncludeTagList "*" -RequiredModulesRepo "PSGallery" Test-Module-MSP: - needs: ["Setup-Build-Dependancies", "Check-PR-Labels"] + needs: ["Setup-Build-Dependencies", "Check-PR-Labels"] runs-on: ubuntu-latest timeout-minutes: 20 steps: @@ -231,7 +231,7 @@ jobs: - uses: actions/cache@v3 with: path: "/home/runner/.local/share/powershell/Modules/" - key: PS-Dependancies + key: PS-Dependencies - shell: pwsh env: PESTER_APIKEY: ${{ secrets.PESTER_APIKEY }} From 381474d7243552c6f94bcff22e16758fb027b694 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 14:38:31 -0700 Subject: [PATCH 33/47] update docs --- PowerShell/Deploy/Build-HelpFiles.ps1 | 32 +++++++------ .../JumpCloud Module/Docs/Connect-JCOnline.md | 2 +- .../JumpCloud Module/Docs/Get-JCCommand.md | 2 +- .../JumpCloud Module/Docs/Get-JCReport.md | 6 +-- .../JumpCloud Module/Docs/Get-JCSystem.md | 2 +- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- .../JumpCloud Module/Docs/New-JCReport.md | 4 +- .../Docs/Set-JCSettingsFile.md | 19 +++++++- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 45 +++++++++++++++---- PowerShell/ModuleChangelog.md | 2 +- 11 files changed, 82 insertions(+), 36 deletions(-) diff --git a/PowerShell/Deploy/Build-HelpFiles.ps1 b/PowerShell/Deploy/Build-HelpFiles.ps1 index 2413e09c0..932810537 100755 --- a/PowerShell/Deploy/Build-HelpFiles.ps1 +++ b/PowerShell/Deploy/Build-HelpFiles.ps1 @@ -1,4 +1,4 @@ -Param( +param( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = 'Name of module')][ValidateNotNullOrEmpty()][System.String]$ModuleName = 'JumpCloud' , [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, HelpMessage = 'Path to module root')][ValidateNotNullOrEmpty()][System.String]$ModulePath = './PowerShell/JumpCloud Module' # $PSScriptRoot , [Parameter(Mandatory = $false, ValueFromPipelineByPropertyName = $true, HelpMessage = 'Which parameter set to be used for New-MarkdownHelp')][ValidateNotNullOrEmpty()][ValidateSet('FromCommand', 'FromModule')][System.String]$NewMarkdownHelpParamSet = 'FromCommand' @@ -61,7 +61,7 @@ $FolderPath_Docs = "$ModulePath/Docs" $FolderPath_enUS = "$ModulePath/$Locale" $FilePath_ModulePagePath = "$FolderPath_Docs/$ModuleName.md" Write-Host ("[status]Creating/Updating help files") -Try { +try { Write-Host ("[status]Installing module: PlatyPS") Install-Module -Repository:('PSGallery') -Name:('PlatyPS') -Force # Import module @@ -74,7 +74,7 @@ Try { ######################################################### ############### Adding Comment based help ############### ######################################################### - If ($AddCommentBasedHelp) { + if ($AddCommentBasedHelp) { $FolderPath_Public = "$ModulePath/Public" # Move the help contents from docs files to ps1 files $DocFiles = Get-ChildItem $FolderPath_Docs @@ -88,15 +88,15 @@ Try { $description = ".Description`r`n" + ($help.description.text).Trim() $examples = $help.examples.example | ForEach-Object { $Example = $_ - $ExampleCode = If ($Example.code -like '*C:\>*') { + $ExampleCode = if ($Example.code -like '*C:\>*') { ($Example.code).split(">")[1] - } Else { + } else { $Example.code } (".Example`r`n" + ($ExampleCode).Trim() + "`r`n`r`n" + ($Example.remarks.text).Trim()) } - $notes = If ($help.alertSet.alert.text) { ".Notes`r`n" + ($help.alertSet.alert.text).Trim() } - $link = If ($help.relatedLinks.navigationLink.uri) { ".Link`r`n" + ($help.relatedLinks.navigationLink.uri).Trim() } + $notes = if ($help.alertSet.alert.text) { ".Notes`r`n" + ($help.alertSet.alert.text).Trim() } + $link = if ($help.relatedLinks.navigationLink.uri) { ".Link`r`n" + ($help.relatedLinks.navigationLink.uri).Trim() } Set-Content $file.FullName -Value "<#", $synopsis, $description, $examples, $notes, $link, "#>" Add-Content $file.FullName -Value $content } @@ -110,16 +110,16 @@ Try { ######################################################### ######################################################### # If not exist create: .\Docs\about_$ModuleName.md - If (-not (Test-Path -Path:("$($FolderPath_Docs)/about_$($ModuleName).md"))) { + if (-not (Test-Path -Path:("$($FolderPath_Docs)/about_$($ModuleName).md"))) { Write-Host ("[status]Creating New-MarkdownAboutHelp") New-MarkdownAboutHelp -OutputFolder:($FolderPath_Docs) -AboutName:($ModuleName) } # Creating help files: .\Docs\*.md Write-Host ("[status]Creating help files: .\Docs\*.md") - Switch ($NewMarkdownHelpParamSet) { + switch ($NewMarkdownHelpParamSet) { 'FromCommand' { $Psd1.FunctionsToExport | ForEach-Object { - If (-not (Test-Path -Path:("$($FolderPath_Docs)/$($_).md"))) { + if (-not (Test-Path -Path:("$($FolderPath_Docs)/$($_).md"))) { $parameters = @{ Command = $_ Force = $true @@ -133,6 +133,7 @@ Try { # Session = '' # Metadata = '' } + Write-Host ("[status]Creating help file for command: $($_)") New-MarkdownHelp @parameters } } @@ -155,9 +156,10 @@ Try { # Session = '' # Metadata = '' } + Write-Host ("[status]Creating help file for command: $($_)") New-MarkdownHelp @parameters } - Default { + default { Write-Error ("Unknown `$NewMarkdownHelpParamSet value: $NewMarkdownHelpParamSet") } } @@ -171,13 +173,15 @@ Try { UpdateInputOutput = $true Force = $true ExcludeDontShow = $true - # LogPath = "$FolderPath_Docs\PlatyPS.log" - # LogAppend = $true + LogPath = "$FolderPath_Docs\PlatyPS.log" + LogAppend = $true # Encoding = '' # Session = '' } + Write-Host ("[status]Updating help files: .\Docs\*.md") Update-MarkdownHelpModule @parameters # Manually updating specific feilds within JumpCloud.md + Write-Host ("[status]Updating JumpCloud.md") $ModulePageContent = Get-Content -Path:($FilePath_ModulePagePath) -Raw $ModulePageContent = $ModulePageContent.Replace("`r", '') $ModulePageContent = $ModulePageContent.Replace("## Description`n{{ Fill in the Description }}", "## Description`n$($Psd1.Description)") @@ -223,7 +227,7 @@ Try { (Get-Content -Path "$FolderPath_enUS/$ModuleName-help.xml" -Raw).Replace($ProgressActionXML1, '') | Set-Content "$FolderPath_enUS/$ModuleName-help.xml" (Get-Content -Path "$FolderPath_enUS/$ModuleName-help.xml" -Raw).Replace($ProgressActionXML2, '') | Set-Content "$FolderPath_enUS/$ModuleName-help.xml" -} Catch { +} catch { Write-Error ($_) } diff --git a/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md b/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md index 939c52a85..d46559775 100644 --- a/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md +++ b/PowerShell/JumpCloud Module/Docs/Connect-JCOnline.md @@ -70,7 +70,7 @@ Specific to JumpCloud development team to connect to staging dev environment. Type: System.String Parameter Sets: (All) Aliases: -Accepted values: production, staging +Accepted values: STANDARD, staging, EU Required: False Position: 3 diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCCommand.md b/PowerShell/JumpCloud Module/Docs/Get-JCCommand.md index 1c27edb84..516038b30 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCCommand.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCCommand.md @@ -188,7 +188,7 @@ Allows you to return select properties on JumpCloud user objects. Specifying wha Type: System.String[] Parameter Sets: SearchFilter Aliases: -Accepted values: command, name, launchType, commandType, trigger, scheduleRepeatType, listensTo, organization, commandRunners, schedule, shell, timeout, sudo, template, scheduleYear, timeToLiveSeconds, files, user, systems, description, filesS3 +Accepted values: aiGenerated, command, name, launchType, commandType, trigger, scheduleRepeatType, listensTo, organization, commandRunners, schedule, shell, timeout, sudo, template, scheduleYear, timeToLiveSeconds, files, user, systems, description, filesS3 Required: False Position: Named diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCReport.md b/PowerShell/JumpCloud Module/Docs/Get-JCReport.md index a3bad536c..01c7466bf 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCReport.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCReport.md @@ -14,12 +14,12 @@ Ordered list of report metadata ### List (Default) ``` -Get-JCReport [-Sort ] [] +Get-JCReport [-Sort ] [] ``` ### Report ``` -Get-JCReport [-Sort ] -ReportID -Type +Get-JCReport [-Sort ] -ReportID -Type [] ``` @@ -80,7 +80,7 @@ Sort type and direction. Default sort is descending, prefix with - to sort ascending. ```yaml -Type: JumpCloud.SDK.DirectoryInsights.Support.Sort +Type: System.Object Parameter Sets: (All) Aliases: diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystem.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystem.md index 0a7c96579..ab70354b0 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystem.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystem.md @@ -357,7 +357,7 @@ Valid properties that can be returned are: 'created', 'active', 'agentVersion', Type: System.String[] Parameter Sets: SearchFilter Aliases: -Accepted values: acknowledged, active, agentVersion, allowMultiFactorAuthentication, allowPublicKeyAuthentication, allowSshPasswordAuthentication, allowSshRootLogin, arch, azureAdJoined, connectionHistory, created, displayName, domainInfo, fde, fileSystem, hasServiceAccount, hostname, lastContact, mdm, modifySSHDConfig, networkInterfaces, organization, os, osFamily, primarySystemUser, provisionMetadata, remoteAssistAgentVersion, remoteIP, serialNumber, serviceAccountState, sshdParams, systemInsights, systemTimezone, templateName, userMetrics, usernameHashes, version, hwVendor, secureLogin, displayManager, amazonInstanceID, archFamily, builtInCommands, description, osVersionDetail, policyStats, desktopCapable, sshRootEnabled, isPolicyBound, agentHasFullDiskAccess +Accepted values: acknowledged, active, agentVersion, allowMultiFactorAuthentication, allowPublicKeyAuthentication, allowSshPasswordAuthentication, allowSshRootLogin, arch, attributes, azureAdJoined, connectionHistory, created, displayName, domainInfo, fde, fileSystem, hasServiceAccount, hostname, lastContact, mdm, modifySSHDConfig, networkInterfaces, organization, os, osFamily, primarySystemUser, provisionMetadata, remoteAssistAgentVersion, remoteIP, serialNumber, serviceAccountState, sshdParams, systemInsights, systemTimezone, templateName, userMetrics, usernameHashes, version, hwVendor, secureLogin, displayManager, amazonInstanceID, archFamily, builtInCommands, description, osVersionDetail, policyStats, desktopCapable, sshRootEnabled, isPolicyBound, agentHasFullDiskAccess Required: False Position: Named diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 9c16945f0..a19041462 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: 2.18.2 +Help Version: 2.19.0 Locale: en-Us --- diff --git a/PowerShell/JumpCloud Module/Docs/New-JCReport.md b/PowerShell/JumpCloud Module/Docs/New-JCReport.md index 2533a570c..6de6815bf 100644 --- a/PowerShell/JumpCloud Module/Docs/New-JCReport.md +++ b/PowerShell/JumpCloud Module/Docs/New-JCReport.md @@ -14,7 +14,7 @@ Request a JumpCloud report to be generated asynchronously ### Create (Default) ``` -New-JCReport -ReportType [-WhatIf] [-Confirm] +New-JCReport -ReportType [-WhatIf] [-Confirm] [] ``` @@ -65,7 +65,7 @@ Accept wildcard characters: False Report Type ```yaml -Type: JumpCloud.SDK.DirectoryInsights.Support.ReportType1 +Type: System.Object Parameter Sets: Create Aliases: diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md b/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md index 1bb2c174f..cb7be978d 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md @@ -14,8 +14,8 @@ Updates the JumpCloud Module Settings File ## SYNTAX ``` -Set-JCSettingsFile [-parallelOverride ] - [-moduleBannerMessageCount ] [] +Set-JCSettingsFile [-moduleBannerMessageCount ] + [-parallelOverride ] [-JCEnvironmentLocation ] [] ``` ## DESCRIPTION @@ -34,6 +34,21 @@ Disables parallel processing of results in the JumpCloud PowerShell Module ## PARAMETERS +### -JCEnvironmentLocation +sets the System.Management.Automation.PSCustomObject Location=@{write=True; copy=True; value=STANDARD} settings for the System.Management.Automation.PSCustomObject JCEnvironment=@{Location=} feature + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -moduleBannerMessageCount sets the messageCount settings for the moduleBanner feature diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 2e480da39..a1e906a0b 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 11/24/2025 +# Generated on: 11/25/2025 # @{ diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 2f77dc900..3243aa6f2 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -2471,8 +2471,9 @@ PS C:\> $BackupJcOrganizationResults.User Specific to JumpCloud development team to connect to staging dev environment. - production + STANDARD staging + EU System.String @@ -4546,6 +4547,7 @@ PS C:\> $BackupJcOrganizationResults.User Allows you to return select properties on JumpCloud user objects. Specifying what properties are returned can drastically increase the speed of the API call with a large data set. Valid properties that can be returned are: 'command', 'name','commandType', 'launchType','listensTo','schedule','trigger','scheduleRepeatType','organization' + aiGenerated command name launchType @@ -8044,9 +8046,9 @@ PS C:\> $BackupJcOrganizationResults.User Sort type and direction. Default sort is descending, prefix with - to sort ascending. - JumpCloud.SDK.DirectoryInsights.Support.Sort + System.Object - JumpCloud.SDK.DirectoryInsights.Support.Sort + System.Object None @@ -8084,9 +8086,9 @@ PS C:\> $BackupJcOrganizationResults.User Sort type and direction. Default sort is descending, prefix with - to sort ascending. - JumpCloud.SDK.DirectoryInsights.Support.Sort + System.Object - JumpCloud.SDK.DirectoryInsights.Support.Sort + System.Object None @@ -8538,6 +8540,7 @@ $reportContent = Get-JCReport -reportID $lastReport.id -type 'csv' allowSshPasswordAuthentication allowSshRootLogin arch + attributes azureAdJoined connectionHistory created @@ -13161,9 +13164,9 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV Report Type - JumpCloud.SDK.DirectoryInsights.Support.ReportType1 + System.Object - JumpCloud.SDK.DirectoryInsights.Support.ReportType1 + System.Object None @@ -13211,9 +13214,9 @@ PS C:\> New-JCPolicy -TemplateName darwin_Login_Window_Text -Values $policyV Report Type - JumpCloud.SDK.DirectoryInsights.Support.ReportType1 + System.Object - JumpCloud.SDK.DirectoryInsights.Support.ReportType1 + System.Object None @@ -20314,6 +20317,18 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli Set-JCSettingsFile + + JCEnvironmentLocation + + sets the System.Management.Automation.PSCustomObject Location=@{write=True; copy=True; value=STANDARD} settings for the System.Management.Automation.PSCustomObject JCEnvironment=@{Location=} feature + + System.Management.Automation.PSObject + + System.Management.Automation.PSObject + + + None + moduleBannerMessageCount @@ -20342,6 +20357,18 @@ PS C:\> Set-JCPolicy -PolicyName "macOS - Login Window Policy" -Values $poli + + JCEnvironmentLocation + + sets the System.Management.Automation.PSCustomObject Location=@{write=True; copy=True; value=STANDARD} settings for the System.Management.Automation.PSCustomObject JCEnvironment=@{Location=} feature + + System.Management.Automation.PSObject + + System.Management.Automation.PSObject + + + None + moduleBannerMessageCount diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index cfe198b20..f1bcfeebc 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,6 +1,6 @@ ## 2.19.0 -Release Date: November 24, 2025 +Release Date: November 25, 2025 #### RELEASE NOTES From e612b51c1b96780b186415c690d74d6ae98cdbc3 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 14:38:46 -0700 Subject: [PATCH 34/47] returnproperties --- .../JumpCloud Module/Public/Commands/Get-JCCommand.ps1 | 4 ++-- .../JumpCloud Module/Public/Systems/Get-JCSystem.ps1 | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1 b/PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1 index 5835bbf2b..4e5c9e527 100644 --- a/PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1 +++ b/PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1 @@ -1,5 +1,5 @@ -Function Get-JCCommand () { +function Get-JCCommand () { [CmdletBinding(DefaultParameterSetName = 'SearchFilter')] param @@ -21,7 +21,7 @@ Function Get-JCCommand () { [ValidateSet('minute', 'hour', 'day', 'week', 'month')] [string]$scheduleRepeatType, [Parameter(ValueFromPipelineByPropertyName, ParameterSetName = 'SearchFilter', HelpMessage = 'Allows you to return select properties on JumpCloud commands objects. Specifying what properties are returned can drastically increase the speed of the API call with a large data set. Valid properties that can be returned are: ''command'', ''name'',''launchType'',''commandType'',''trigger'',''scheduleRepeatType'',''listensTo'',''organization'',''commandRunners'',''schedule'',''shell'',''timeout'',''sudo'',''template'',''scheduleYear'',''timeToLiveSeconds'',''files'',''user'',''systems'', ''description'', ''filesS3''')] - [ValidateSet('command', 'name', 'launchType', 'commandType', 'trigger', 'scheduleRepeatType', 'listensTo', 'organization', 'commandRunners', 'schedule', 'shell', 'timeout', 'sudo', 'template', 'scheduleYear', 'timeToLiveSeconds', 'files', 'user', 'systems', 'description', 'filesS3')] + [ValidateSet('aiGenerated', 'command', 'name', 'launchType', 'commandType', 'trigger', 'scheduleRepeatType', 'listensTo', 'organization', 'commandRunners', 'schedule', 'shell', 'timeout', 'sudo', 'template', 'scheduleYear', 'timeToLiveSeconds', 'files', 'user', 'systems', 'description', 'filesS3')] [String[]]$returnProperties, [Parameter(Mandatory, ValueFromPipelineByPropertyName, diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1 index f42347bde..2628f9a21 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystem.ps1 @@ -1,4 +1,4 @@ -Function Get-JCSystem () { +function Get-JCSystem () { [CmdletBinding(DefaultParameterSetName = 'SearchFilter')] param @@ -153,12 +153,12 @@ Function Get-JCSystem () { ValueFromPipelineByPropertyName, ParameterSetName = 'SearchFilter', HelpMessage = 'Allows you to return select properties on JumpCloud system objects. Specifying what properties are returned can drastically increase the speed of the API call with a large data set. Valid properties that can be returned are: ''created'', ''active'', ''agentVersion'', ''allowMultiFactorAuthentication'', ''allowPublicKeyAuthentication'', ''allowSshPasswordAuthentication'', ''allowSshRootLogin'', ''arch'', ''created'', ''displayName'', ''hostname'', ''lastContact'', ''modifySSHDConfig'', ''organization'', ''os'', ''remoteIP'', ''serialNumber'', ''sshdParams'', ''systemTimezone'', ''templateName'', ''version'', ''hwVendor'',''secureLogin'',''displayManager'',''amazonInstanceID'',''archFamily'',''builtInCommands'',''description'',''osVersionDetail'',''policyStats'',''desktopCapable'', ''sshRootEnabled'', ''agentHasFullDiskAccess''')] - [ValidateSet('acknowledged', 'active', 'agentVersion', 'allowMultiFactorAuthentication', 'allowPublicKeyAuthentication', 'allowSshPasswordAuthentication', 'allowSshRootLogin', 'arch', 'azureAdJoined', 'connectionHistory', 'created', 'displayName', 'domainInfo', 'fde', 'fileSystem', 'hasServiceAccount', 'hostname', 'lastContact', 'mdm', 'modifySSHDConfig', 'networkInterfaces', 'organization', 'os', 'osFamily', 'primarySystemUser', 'provisionMetadata', 'remoteAssistAgentVersion', 'remoteIP', 'serialNumber', 'serviceAccountState', 'sshdParams', 'systemInsights', 'systemTimezone', 'templateName', 'userMetrics', 'usernameHashes', 'version', 'hwVendor', 'secureLogin', 'displayManager', 'amazonInstanceID', 'archFamily', 'builtInCommands', 'description', 'osVersionDetail', 'policyStats', 'desktopCapable', 'sshRootEnabled', 'isPolicyBound', 'agentHasFullDiskAccess')] + [ValidateSet('acknowledged', 'active', 'agentVersion', 'allowMultiFactorAuthentication', 'allowPublicKeyAuthentication', 'allowSshPasswordAuthentication', 'allowSshRootLogin', 'arch', 'attributes', 'azureAdJoined', 'connectionHistory', 'created', 'displayName', 'domainInfo', 'fde', 'fileSystem', 'hasServiceAccount', 'hostname', 'lastContact', 'mdm', 'modifySSHDConfig', 'networkInterfaces', 'organization', 'os', 'osFamily', 'primarySystemUser', 'provisionMetadata', 'remoteAssistAgentVersion', 'remoteIP', 'serialNumber', 'serviceAccountState', 'sshdParams', 'systemInsights', 'systemTimezone', 'templateName', 'userMetrics', 'usernameHashes', 'version', 'hwVendor', 'secureLogin', 'displayManager', 'amazonInstanceID', 'archFamily', 'builtInCommands', 'description', 'osVersionDetail', 'policyStats', 'desktopCapable', 'sshRootEnabled', 'isPolicyBound', 'agentHasFullDiskAccess')] [String[]]$returnProperties ) - DynamicParam { - If ((Get-PSCallStack).Command -like '*MarkdownHelp') { + dynamicparam { + if ((Get-PSCallStack).Command -like '*MarkdownHelp') { $filterDateProperty = 'created' } if ($filterDateProperty) { @@ -444,7 +444,7 @@ Function Get-JCSystem () { $pipelineLength, $functions = Get-PipelineDetails -line $MyInvocation.Line $setAfterGet = Get-PipelinePositionBefore -before "Get-JCSystem" -after "Set-JCSystem" -functionArray $functions if ($pipelineLength -gt 1) { - if (($resultsArrayList.Count -ne 0) -And ($setAfterGet -eq $true)) { + if (($resultsArrayList.Count -ne 0) -and ($setAfterGet -eq $true)) { foreach ($item in $resultsArrayList) { $itemSysInsightsState = switch ($item.systemInsights.state) { 'enabled' { From 122f4f02e9a381475f434623e72e303e82cba6ea Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 14:38:56 -0700 Subject: [PATCH 35/47] properly set jcenvironment --- .../Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 index 902dab271..917dde6f8 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 @@ -9,7 +9,7 @@ Describe -Tag:('JCOnline') 'Connect-JCOnline Tests' { } Context 'EU Org Tests' { It ('Should connect using the EU JumpCloudApiKey and JumpCloudOrgId parameters.') { - $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_EU_ApiKey) -JumpCloudOrgId:($PesterParams_EU_OrgID) -force + $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_EU_ApiKey) -JumpCloudOrgId:($PesterParams_EU_OrgID) -JCEnvironment 'EU' -force $PesterParams_EU_ApiKey | Should -Be $env:JCApiKey $PesterParams_EU_OrgID | Should -Be $env:JCOrgId From cca00d631b180307da4c82d06e476f6f6251dfa5 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 14:39:09 -0700 Subject: [PATCH 36/47] fix params --- .../Public/Reports/Get-JCReport.ps1 | 2 -- .../Public/Reports/New-JCReport.ps1 | 14 ++++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Reports/Get-JCReport.ps1 b/PowerShell/JumpCloud Module/Public/Reports/Get-JCReport.ps1 index 528c564ee..17756c60a 100644 --- a/PowerShell/JumpCloud Module/Public/Reports/Get-JCReport.ps1 +++ b/PowerShell/JumpCloud Module/Public/Reports/Get-JCReport.ps1 @@ -22,9 +22,7 @@ function Get-JCReport { [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] param( [Parameter()] - [ArgumentCompleter([JumpCloud.SDK.DirectoryInsights.Support.Sort])] [JumpCloud.SDK.DirectoryInsights.Category('Query')] - [JumpCloud.SDK.DirectoryInsights.Support.Sort] # Sort type and direction. # Default sort is descending, prefix with - to sort ascending. ${Sort}, diff --git a/PowerShell/JumpCloud Module/Public/Reports/New-JCReport.ps1 b/PowerShell/JumpCloud Module/Public/Reports/New-JCReport.ps1 index d70dbb984..3e15b17e6 100644 --- a/PowerShell/JumpCloud Module/Public/Reports/New-JCReport.ps1 +++ b/PowerShell/JumpCloud Module/Public/Reports/New-JCReport.ps1 @@ -26,14 +26,12 @@ INPUTOBJECT : Identity Parameter .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/New-JcSdkReport.md #> -Function New-JCReport { +function New-JCReport { [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPathsE6Q3GdReportsReportTypePostResponses202ContentApplicationJsonSchema])] [CmdletBinding(DefaultParameterSetName = 'Create', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')] - Param( + param( [Parameter(ParameterSetName = 'Create', Mandatory)] - [ArgumentCompleter([JumpCloud.SDK.DirectoryInsights.Support.ReportType1])] [JumpCloud.SDK.DirectoryInsights.Category('Path')] - [JumpCloud.SDK.DirectoryInsights.Support.ReportType1] [ValidateSet("browser-patch-policy", "os-patch-policy", "users-to-devices", "users-to-directories", "users-to-ldap-servers", "users-to-radius-servers", "users-to-sso-applications", "users-to-user-groups")] # Report Type ${ReportType}, @@ -45,14 +43,14 @@ Function New-JCReport { # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject} ) - Begin { + begin { Connect-JCOnline -force | Out-Null $Results = @() } - Process { + process { $Results = JumpCloud.SDK.DirectoryInsights\New-JcSdkReport @PSBoundParameters } - End { - Return $Results + end { + return $Results } } From e75be66e1f05fe8029fa06e4e08cbd5b4b0f7bb7 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 15:18:18 -0700 Subject: [PATCH 37/47] Update Connect-JCOnline.Tests.ps1 --- .../Public/Authentication/Connect-JCOnline.Tests.ps1 | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 index 917dde6f8..e9741c770 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 @@ -15,10 +15,12 @@ Describe -Tag:('JCOnline') 'Connect-JCOnline Tests' { $env:JCEnvironment | Should -Be 'EU' - $global:PSDefaultParameterValues['*-JcSdk*:ApiHost'] | Should -Be "api.eu" - $global:PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] | Should -Be "console.eu" - # $Connect.JCOrgId | Should -Be $env:JCOrgId - # $Connect.JCOrgId | Should -Be $PesterParams_EU_Org.OrgID + $PSDefaultParameterValues['*-JcSdk*:ApiHost'] | Should -Be "api.eu" + $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] | Should -Be "console.eu" + + $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org.OrgID) -JCEnvironment 'STANDARD' -force + $PesterParams_ApiKey | Should -Be $env:JCApiKey + $PesterParams_Org.OrgID | Should -Be $env:JCOrgId } } Context 'Single Org Tests' { From 758b8771c9a09a64204f57c3f39669d91f4a69da Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 25 Nov 2025 16:28:12 -0700 Subject: [PATCH 38/47] Update Connect-JCOnline.Tests.ps1 --- .../Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 index e9741c770..0c5801bba 100755 --- a/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Authentication/Connect-JCOnline.Tests.ps1 @@ -15,9 +15,6 @@ Describe -Tag:('JCOnline') 'Connect-JCOnline Tests' { $env:JCEnvironment | Should -Be 'EU' - $PSDefaultParameterValues['*-JcSdk*:ApiHost'] | Should -Be "api.eu" - $PSDefaultParameterValues['*-JcSdk*:ConsoleHost'] | Should -Be "console.eu" - $Connect = Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -JumpCloudOrgId:($PesterParams_Org.OrgID) -JCEnvironment 'STANDARD' -force $PesterParams_ApiKey | Should -Be $env:JCApiKey $PesterParams_Org.OrgID | Should -Be $env:JCOrgId From 3b4a1f52309afa5b46319aefececd7b8fd1d14fa Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 1 Dec 2025 11:50:28 -0700 Subject: [PATCH 39/47] fix policy test --- .../Tests/Public/Policies/New-JCPolicy.Tests.ps1 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Policies/New-JCPolicy.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Policies/New-JCPolicy.Tests.ps1 index 231138381..76c156dd0 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Policies/New-JCPolicy.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Policies/New-JCPolicy.Tests.ps1 @@ -18,7 +18,8 @@ Describe -Tag:('JCPolicy') 'New-JCPolicy' { $templateId = $policyTemplate.id $intValue = 45 $intPolicy = New-JCPolicy -Name "Pester - Integer Dynamic" -templateID $templateId -timeout $intValue - $intPolicy.values.value | Should -Be $intValue + $intPolicyTimeoutValue = $intPolicy.Values | Where-Object { $_.ConfigFieldName -eq 'timeout' } + $intPolicyTimeoutValue.value | Should -Be $intValue } It 'Creates a new policy that tests boolean' { From 2f5b165d6f7865ec92b82637e08efffed64960e8 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Mon, 1 Dec 2025 11:54:50 -0700 Subject: [PATCH 40/47] fix policy tests --- .../Tests/Public/Policies/Set-JCPolicy.Tests.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Policies/Set-JCPolicy.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Policies/Set-JCPolicy.Tests.ps1 index 7f49e8889..63317587f 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Policies/Set-JCPolicy.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Policies/Set-JCPolicy.Tests.ps1 @@ -169,8 +169,9 @@ Describe -Tag:('JCPolicy') 'Set-JCPolicy' { $intPolicy = New-JCPolicy -Name "Pester - Integer" -templateID $templateId -timeout $intValue $updatedIntValue = 55 $updatedStringPolicy = Set-JCPolicy -policyID $intPolicy.id -timeout $updatedIntValue + $intPolicyTimeoutValue = $updatedStringPolicy.Values | Where-Object { $_.ConfigFieldName -eq 'timeout' } # Should not be null - $updatedStringPolicy.values.value | Should -Be $updatedIntValue + $intPolicyTimeoutValue.value | Should -Be $updatedIntValue } It 'Sets a policy with a boolean, multi select and string type dynamic parameter' { $policyTemplate = $policyTemplates | Where-Object { $_.name -eq "app_notifications_darwin" } @@ -334,8 +335,9 @@ Describe -Tag:('JCPolicy') 'Set-JCPolicy' { $stringPolicy = New-JCPolicy -Name "Pester - Integer byName" -templateID $templateId -timeout $intValue $updatedIntValue = 55 $updatedStringPolicy = Set-JCPolicy -PolicyName $stringPolicy.Name -timeout $updatedIntValue + $intPolicyTimeoutValue = $updatedStringPolicy.Values | Where-Object { $_.ConfigFieldName -eq 'timeout' } # Should not be null - $updatedStringPolicy.values.value | Should -Be $updatedIntValue + $intPolicyTimeoutValue.value | Should -Be $updatedIntValue } It 'Sets a policy with a boolean, multi select and string type dynamic parameter' { $policyTemplate = $policyTemplates | Where-Object { $_.name -eq "app_notifications_darwin" } From 575b26d29aab31eac6e0ed723eeea9b4081d367c Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 2 Dec 2025 08:25:40 -0700 Subject: [PATCH 41/47] return object with new SDKs --- .../Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 index fa672ca39..2d0dc4ebf 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 @@ -35,11 +35,11 @@ Describe 'Get-JCEventCount' -Tag:('JCEvent') { It 'GetExpanded' { $eventTest = Get-JCEventCount -Service:($ParamHash.Service) -StartTime:($ParamHash.StartTime) -EndTime:($ParamHash.EndTime) -Sort:($ParamHash.Sort) -SearchTermAnd:($ParamHash.SearchTermAnd) $eventTest | Should -Not -BeNullOrEmpty - $eventTest | Should -BeOfType System.Int64 + $eventTest.Count | Should -BeOfType System.Int64 } It 'Get' { $eventTest = Get-JCEventCount -Body:($ParamHash) $eventTest | Should -Not -BeNullOrEmpty - $eventTest | Should -BeOfType System.Int64 + $eventTest.Count | Should -BeOfType System.Int64 } } From 8d9c64386049d487c802a90b0cf267e299dfb64a Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 2 Dec 2025 09:10:17 -0700 Subject: [PATCH 42/47] association tests new user, sdk generation, changelogs --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- .../Public/DirectoryInsights/Get-JCEvent.ps1 | 56 +++++++------------ .../DirectoryInsights/Get-JCEventCount.ps1 | 44 ++++++++------- .../Association/Get-JCAssociation.Tests.ps1 | 26 +++++---- PowerShell/ModuleChangelog.md | 2 +- 5 files changed, 62 insertions(+), 68 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index a1e906a0b..85806abb7 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 11/25/2025 +# Generated on: 12/2/2025 # @{ diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 index b9978752a..ababd1aec 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 @@ -12,37 +12,9 @@ Query the API for Directory Insights events curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' ``` .Example -PS C:\> Get-JCEvent -Service:('all') -StartTime:((Get-date).AddDays(-30)) - -Pull all event records from the last thirty days -.Example -PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddHours(-1)) -Limit:('10') - -Get directory results from the last hour limit to the last 10 results in the time range -.Example -PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -Sort:("DESC") -EndTime:((Get-date).AddDays(-5)) - -Get directory results between 30 and 5 days ago, sort timestamp by descending value -.Example -PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -Limit:('10') -searchTermAnd:@{"event_type" = "group_create"} - -Get only group_create from the last thirty days -.Example -PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermOr @{"initiated_by.username" = @("user.1", "user.2")} - -Get login events initiated by either "user.1" or "user.2" between a universal time zone range -.Example -PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "admin_login_attempt"; "resource.email" = "admin.user@adminbizorg.com"} - -Get all events between a date range and match event_type = admin_login_attempt and resource.email = admin.user@adminbizorg.com -.Example -PS C:\> Get-JCEvent -Service:('sso') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"initiated_by.username" = "user.1"} - -Get sso events with the search term initiated_by: username with value "user.1" +Get-JCEvent -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Limit:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Skip:() -Sort:() .Example -PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "organization_update"} - -Get all events filtered by organization_update term between a date range +Get-JCEvent -Body:() .Inputs JumpCloud.SDK.DirectoryInsights.Models.IEventQuery @@ -54,25 +26,34 @@ COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. BODY : EventQuery is the users' command to search our auth logs - Service : service name to query. + Service >: service name to query. StartTime : query start time, UTC in RFC3339 format [EndTime ]: optional query end time, UTC in RFC3339 format - [Fields ]: optional list of fields to return from query + [ExactMatch ]: optional string for specifying exact match query, do not use with full text query + [Fields >]: optional list of fields to return from query [Limit ]: Max number of rows to return [Q ]: optional string for specifying a full text query - [SearchAfter ]: Specific query to search after, see x-* response headers for next values + [SearchAfter >]: Specific query to search after, see x-* response headers for next values [SearchTermAnd ]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values [(Any) ]: This indicates any property can be added to this object. [SearchTermNot ]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values [SearchTermOr ]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values + [Skip ]: optional offset into the result set to start with when returning [Sort ]: ASC or DESC order for timestamp .Link -https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md +https://github.com/TheJumpCloud/jcapi-powershell/tree/CUT-4908_userGroupDeviceGroupFilters/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md #> Function Get-JCEvent { [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])] [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] Param( + [Parameter(Mandatory)] + [JumpCloud.SDK.DirectoryInsights.Category('Uri')] + [System.String] + # Region for JumpCloud API host. + # Use 'api' for US or 'api.eu' for EU. + ${ApiHost}, + [Parameter(ParameterSetName='GetExpanded', Mandatory)] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] @@ -92,6 +73,12 @@ Function Get-JCEvent { # optional query end time, UTC in RFC3339 format ${EndTime}, + [Parameter(ParameterSetName='GetExpanded')] + [JumpCloud.SDK.DirectoryInsights.Category('Body')] + [System.String] + # optional string for specifying exact match query, do not use with full text query + ${ExactMatch}, + [Parameter(ParameterSetName='GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] @@ -149,7 +136,6 @@ Function Get-JCEvent { [JumpCloud.SDK.DirectoryInsights.Category('Body')] [JumpCloud.SDK.DirectoryInsights.Models.IEventQuery] # EventQuery is the users' command to search our auth logs - # To construct, see NOTES section for BODY properties and create a hash table. ${Body} ) Begin { diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 index d289da86f..c32c4a8e3 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 @@ -12,51 +12,48 @@ Query the API for a count of matching events curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events/count' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' ``` .Example -PS C:\> Get-JCEventCount -Service:('all') -StartTime:((Get-date).AddDays(-30)) - -Pull all event records from a specified time and count the results -.Example -PS C:\> Get-JCEventCount -Service:('sso') -StartTime:('2020-04-14T00:00:00Z') - -Pull all SSO event records from a specified time and count the results +Get-JCEventCount -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Sort:() .Example -PS C:\> Get-JCEventCount -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "admin_login_attempt"; "resource.email" = "admin.user@adminbizorg.com"} - -Get all events counts between a date range and match event_type = admin_login_attempt and resource.email = admin.user@adminbizorg.com -.Example -PS C:\> Get-JCEventCount -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -searchTermAnd:@{"event_type" = "group_create"} - -Get only group_create event counts the last thirty days +Get-JCEventCount -Body:() .Inputs JumpCloud.SDK.DirectoryInsights.Models.IEventQuery .Outputs -System.Int64 +JumpCloud.SDK.DirectoryInsights.Models.IEventCount .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. BODY : EventQuery is the users' command to search our auth logs - Service : service name to query. + Service >: service name to query. StartTime : query start time, UTC in RFC3339 format [EndTime ]: optional query end time, UTC in RFC3339 format - [Fields ]: optional list of fields to return from query + [ExactMatch ]: optional string for specifying exact match query, do not use with full text query + [Fields >]: optional list of fields to return from query [Limit ]: Max number of rows to return [Q ]: optional string for specifying a full text query - [SearchAfter ]: Specific query to search after, see x-* response headers for next values + [SearchAfter >]: Specific query to search after, see x-* response headers for next values [SearchTermAnd ]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values [(Any) ]: This indicates any property can be added to this object. [SearchTermNot ]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values [SearchTermOr ]: TermConjunction represents a conjunction (and/or) NOTE: the validator limits what the operator can be, not the object for future-proof-ness and a list of sub-values + [Skip ]: optional offset into the result set to start with when returning [Sort ]: ASC or DESC order for timestamp .Link -https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md +https://github.com/TheJumpCloud/jcapi-powershell/tree/CUT-4908_userGroupDeviceGroupFilters/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md #> Function Get-JCEventCount { - [OutputType([System.Int64])] + [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IEventCount])] [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] Param( + [Parameter(Mandatory)] + [JumpCloud.SDK.DirectoryInsights.Category('Uri')] + [System.String] + # Region for JumpCloud API host. + # Use 'api' for US or 'api.eu' for EU. + ${ApiHost}, + [Parameter(ParameterSetName='GetExpanded', Mandatory)] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] @@ -76,6 +73,12 @@ Function Get-JCEventCount { # optional query end time, UTC in RFC3339 format ${EndTime}, + [Parameter(ParameterSetName='GetExpanded')] + [JumpCloud.SDK.DirectoryInsights.Category('Body')] + [System.String] + # optional string for specifying exact match query, do not use with full text query + ${ExactMatch}, + [Parameter(ParameterSetName='GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] @@ -127,7 +130,6 @@ Function Get-JCEventCount { [JumpCloud.SDK.DirectoryInsights.Category('Body')] [JumpCloud.SDK.DirectoryInsights.Models.IEventQuery] # EventQuery is the users' command to search our auth logs - # To construct, see NOTES section for BODY properties and create a hash table. ${Body} ) Begin { diff --git a/PowerShell/JumpCloud Module/Tests/Public/Association/Get-JCAssociation.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Association/Get-JCAssociation.Tests.ps1 index 3a86dcb6e..345487e99 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Association/Get-JCAssociation.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Association/Get-JCAssociation.Tests.ps1 @@ -3,13 +3,19 @@ Describe -Tag:('JCAssociation') "Association Tests" { # Generate possible associations $JCAssociationTypes = Get-JCType | Where-Object { $_.Category -eq 'JumpCloud' } # | Get-Random -Count 1 # remove when not testing $EmptySources = @() - ForEach ($JCAssociationType In $JCAssociationTypes) { - $Source = Get-JCObject -Type:($JCAssociationType.TypeName.TypeNameSingular) | Select-Object -First 1 # | Get-Random - $AssociationDataSet = If ($Source) { - ForEach ($TargetSingular In $Source.Targets.TargetSingular) { - If ( $TargetSingular -notin $EmptySources) { + foreach ($JCAssociationType in $JCAssociationTypes) { + if ($JCAssociationType.TypeName.TypeNameSingular -eq 'user') { + $NewUser = New-RandomUser -domain "association.$(New-RandomString -NumberOfChars 5)" | New-JCUser + $Source = $NewUser + + } else { + $Source = Get-JCObject -Type:($JCAssociationType.TypeName.TypeNameSingular) | Select-Object -First 1 # | Get-Random + } + $AssociationDataSet = if ($Source) { + foreach ($TargetSingular in $Source.Targets.TargetSingular) { + if ( $TargetSingular -notin $EmptySources) { $Target = Get-JCObject -Type:($TargetSingular) | Get-Random -Count 1 # | Select-Object -First 1 # | Get-Random - If ($Target) { + if ($Target) { @{ 'SourceType' = $Source.TypeName.TypeNameSingular; 'SourceId' = $Source.($Source.ById); @@ -21,7 +27,7 @@ Describe -Tag:('JCAssociation') "Association Tests" { 'Target' = $Target; 'ValidRecord' = $true; } - } Else { + } else { $EmptySources += $TargetSingular @{ 'SourceType' = $Source.TypeName.TypeNameSingular; @@ -37,7 +43,7 @@ Describe -Tag:('JCAssociation') "Association Tests" { } } } - } Else { + } else { $EmptySources += $JCAssociationType.TypeName.TypeNameSingular $JCAssociationType.Targets | ForEach-Object { @{ @@ -152,10 +158,10 @@ Describe -Tag:('JCAssociation') "Association Tests" { Write-Host("Test Object" + $Associations_Test) $Associations_Test | Should -Not -BeNullOrEmpty ($Associations_Test | Measure-Object).Count | Should -BeGreaterThan 0 - If ($value -match '-Raw') { + if ($value -match '-Raw') { $TestParam.TargetId | Should -BeIn $Associations_Test.Id $TestParam.TargetType | Should -BeIn $Associations_Test.Type - } Else { + } else { $TestParam.TargetId | Should -BeIn $Associations_Test.TargetId $TestParam.TargetType | Should -BeIn $Associations_Test.TargetType $TestParam.SourceId | Should -BeIn $Associations_Test.Id diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index f1bcfeebc..971882f40 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,6 +1,6 @@ ## 2.19.0 -Release Date: November 25, 2025 +Release Date: December 2, 2025 #### RELEASE NOTES From aeccf4a97a8f886ad7d2cd90f0513951477486a7 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 2 Dec 2025 09:48:36 -0700 Subject: [PATCH 43/47] 3.0.0 --- .../Deploy/SdkSync/jcapiToSupportSync.ps1 | 22 +- .../JumpCloud Module/Docs/Get-JCEvent.md | 19 +- .../JumpCloud Module/Docs/Get-JCEventCount.md | 25 +- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/Docs/PlatyPS.log | 828 ++++++++++++++++++ .../Docs/Set-JCSettingsFile.md | 4 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- .../Public/DirectoryInsights/Get-JCEvent.ps1 | 7 - .../DirectoryInsights/Get-JCEventCount.ps1 | 7 - .../Tests/HelperFunctions.ps1 | 12 +- .../ModuleValidation/HelpFiles.Tests.ps1 | 10 +- .../ModuleValidation/SDKImport.Tests.ps1 | 8 +- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 50 +- PowerShell/ModuleChangelog.md | 2 +- 14 files changed, 945 insertions(+), 53 deletions(-) diff --git a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 index b1184744d..7c77bb49b 100644 --- a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 +++ b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 @@ -113,10 +113,10 @@ $PSD1_Module = Test-ModuleManifest -Path:("$FilePath_psd1") Get-Module -Refresh -ListAvailable -All | Out-Null $Modules = Get-Module -Name:($Psd1.RequiredModules | Where-Object { $_ -in $ApprovedFunctions.Keys }) -If (-not [System.String]::IsNullOrEmpty($Modules)) { - ForEach ($Module In $Modules) { +if (-not [System.String]::IsNullOrEmpty($Modules)) { + foreach ($Module in $Modules) { $ModuleName = $Module.Name - ForEach ($Function In $ApprovedFunctions.$ModuleName) { + foreach ($Function in $ApprovedFunctions.$ModuleName) { $FunctionName = $Function.Name $FunctionDestination = $Function.Destination $OutputPath = Join-Path -Path $JumpCloudModulePath -ChildPath $FunctionDestination #"$JumpCloudModulePath/$FunctionDestination" @@ -128,7 +128,7 @@ If (-not [System.String]::IsNullOrEmpty($Modules)) { # Get content from sdk function $CommandFilePath = $individualCommand.ScriptBlock.File $CommandFilePathContent = Get-Content -Path:($CommandFilePath) -Raw - $FunctionContent = If ($CommandFilePath -like '*ProxyCmdletDefinitions.ps1') { + $FunctionContent = if ($CommandFilePath -like '*ProxyCmdletDefinitions.ps1') { <# When the autorest generated module has been installed and imported from the PSGallery all the cmdlets will exist in a single ProxyCmdletDefinitions.ps1 file. We need to parse out the specific function in order to gather the parts we need to copy over. #> @@ -140,7 +140,7 @@ If (-not [System.String]::IsNullOrEmpty($Modules)) { $functionSplit } } - } Else { + } else { <# When the autorest generated module has been imported from a local psd1 module the function will remain in their individual files. #> $CommandFilePathContent @@ -148,7 +148,7 @@ If (-not [System.String]::IsNullOrEmpty($Modules)) { # Extract the sections we want to copy over to our new function. $PSScriptInfo = ($FunctionContent | Select-String -Pattern:([regex]'(?s)(<#)(.*?)(#>)')).Matches.Value $Params = $FunctionContent | Select-String -Pattern:([regex]'(?s)( \[Parameter)(.*?)(\})') -AllMatches - $ParameterContent = ($Params.Matches.Value | Where-Object { $_ -notlike '*DontShow*' -and $_ -notlike '${Limit}' -and $_ -notlike '*${Skip}*' }) + $ParameterContent = ($Params.Matches.Value | Where-Object { $_ -notlike '*DontShow*' -and $_ -notlike '${Limit}' -and $_ -notlike '*${Skip}*' -and $_ -notlike '*${apiHost}*' -and $_ -notlike '*${consoleHost}*' }) # Check if there is only one parameter if ($ParameterContent -is [string]) { @@ -166,7 +166,7 @@ If (-not [System.String]::IsNullOrEmpty($Modules)) { # declare param here string $paramString = @" "@ - ForEach ($line in $($ParameterContent -split "`n")) { + foreach ($line in $($ParameterContent -split "`n")) { # for the last item don't add a new line: if ($line -eq $($ParameterContent -split "`n")[-1] ) { $line = $line -replace '(^\s+|\s+$)', '' @@ -183,7 +183,7 @@ If (-not [System.String]::IsNullOrEmpty($Modules)) { } $OutputType = (($FunctionContent | Select-String -Pattern:([regex]'(\[OutputType)(.*?)(\]\s+)')).Matches.Value).TrimEnd() $CmdletBinding = (($FunctionContent | Select-String -Pattern:([regex]'(\[CmdletBinding)(.*?)(\]\s+)')).Matches.Value).TrimEnd() - If (-not [System.String]::IsNullOrEmpty($PSScriptInfo)) { + if (-not [System.String]::IsNullOrEmpty($PSScriptInfo)) { $PSScriptInfo = $PSScriptInfo.Replace($SdkPrefix, $JumpCloudModulePrefix) $PSScriptInfo = $PSScriptInfo.Replace("$NewCommandName.md", "$FunctionName.md") } @@ -226,14 +226,14 @@ $paramString $NewScript | Out-File -FilePath:($OutputFilePath) -Force # Validate script syntax $ScriptAnalyzerResult = Invoke-ScriptAnalyzer -Path:($OutputFilePath) -Recurse -ExcludeRule PSShouldProcess, PSAvoidTrailingWhitespace, PSAvoidUsingWMICmdlet, PSAvoidUsingPlainTextForPassword, PSAvoidUsingUsernameAndPasswordParams, PSAvoidUsingInvokeExpression, PSUseDeclaredVarsMoreThanAssignments, PSUseSingularNouns, PSAvoidGlobalVars, PSUseShouldProcessForStateChangingFunctions, PSAvoidUsingWriteHost, PSAvoidUsingPositionalParameters - If ($ScriptAnalyzerResult) { + if ($ScriptAnalyzerResult) { $ScriptAnalyzerResults += $ScriptAnalyzerResult } # Copy tests? # Copy-Item -Path:($AutoRest_Tests) -Destination:($JCModule_Tests) -Force # Update .Psd1 file - If ($NewCommandName -notin $PSD1_Module.ExportedFunctions.keys) { + if ($NewCommandName -notin $PSD1_Module.ExportedFunctions.keys) { $Psd1.FunctionsToExport += $NewCommandName Update-ModuleManifest -Path:($FilePath_psd1) -FunctionsToExport:($Psd1.FunctionsToExport) } @@ -241,6 +241,6 @@ $paramString } } } -} Else { +} else { Write-Error ('No modules found!') } \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCEvent.md b/PowerShell/JumpCloud Module/Docs/Get-JCEvent.md index 71fe2c16d..2ed87417c 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCEvent.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCEvent.md @@ -14,8 +14,8 @@ Query the API for Directory Insights events ### GetExpanded (Default) ``` -Get-JCEvent -Service -StartTime [-EndTime ] [-Fields ] - [-Limit ] [-Q ] [-SearchAfter ] [-SearchTermAnd ] +Get-JCEvent -Service -StartTime [-EndTime ] [-ExactMatch ] + [-Fields ] [-Limit ] [-Q ] [-SearchAfter ] [-SearchTermAnd ] [-SearchTermNot ] [-SearchTermOr ] [-Sort ] [-WhatIf] [-Confirm] [] ``` @@ -119,6 +119,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ExactMatch +optional string for specifying exact match query, do not use with full text query + +```yaml +Type: System.String +Parameter Sets: GetExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Fields optional list of fields to return from query diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCEventCount.md b/PowerShell/JumpCloud Module/Docs/Get-JCEventCount.md index 5cdeb0ece..9dceede2e 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCEventCount.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCEventCount.md @@ -14,10 +14,10 @@ Query the API for a count of matching events ### GetExpanded (Default) ``` -Get-JCEventCount -Service -StartTime [-EndTime ] [-Fields ] - [-Q ] [-SearchAfter ] [-SearchTermAnd ] [-SearchTermNot ] - [-SearchTermOr ] [-Sort ] [-WhatIf] [-Confirm] - [] +Get-JCEventCount -Service -StartTime [-EndTime ] [-ExactMatch ] + [-Fields ] [-Q ] [-SearchAfter ] [-SearchTermAnd ] + [-SearchTermNot ] [-SearchTermOr ] [-Sort ] + [-WhatIf] [-Confirm] [] ``` ### Get @@ -92,6 +92,21 @@ Accept pipeline input: False Accept wildcard characters: False ``` +### -ExactMatch +optional string for specifying exact match query, do not use with full text query + +```yaml +Type: System.String +Parameter Sets: GetExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + ### -Fields optional list of fields to return from query @@ -267,7 +282,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ### JumpCloud.SDK.DirectoryInsights.Models.IEventQuery ## OUTPUTS -### System.Int64 +### JumpCloud.SDK.DirectoryInsights.Models.IEventCount ## NOTES COMPLEX PARAMETER PROPERTIES diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index a19041462..977420f2d 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: 2.19.0 +Help Version: 3.0.0 Locale: en-Us --- diff --git a/PowerShell/JumpCloud Module/Docs/PlatyPS.log b/PowerShell/JumpCloud Module/Docs/PlatyPS.log index 7d75bf7e7..1e05eb82d 100644 --- a/PowerShell/JumpCloud Module/Docs/PlatyPS.log +++ b/PowerShell/JumpCloud Module/Docs/PlatyPS.log @@ -1021,3 +1021,831 @@ ---- COMPLETED UPDATING Cmdlet : Update-JCUsersFromCSV ---- +[Update-MarkdownHelpModule] 12/02/2025 09:47:21 Determined module name for '/Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Docs' as 'JumpCloud'. +[Update-MarkdownHelpModule] 12/02/2025 09:47:21 [Update-MarkdownHelpModule]12/2/2025 9:47:21 AM +[Update-MarkdownHelpModule] 12/02/2025 09:47:21 Updating documents for module 'JumpCloud' in /Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Docs +---- UPDATING Cmdlet : Add-JCAssociation ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Add-JCAssociation ---- + + +---- UPDATING Cmdlet : Add-JCCommandTarget ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Add-JCCommandTarget ---- + + +---- UPDATING Cmdlet : Add-JCGsuiteMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Add-JCGsuiteMember ---- + + +---- UPDATING Cmdlet : Add-JCOffice365Member ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Add-JCOffice365Member ---- + + +---- UPDATING Cmdlet : Add-JCRadiusReplyAttribute ---- + + Parameter Set Added: ByGroup + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Add-JCRadiusReplyAttribute ---- + + +---- UPDATING Cmdlet : Add-JCSystemGroupMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Add-JCSystemGroupMember ---- + + +---- UPDATING Cmdlet : Add-JCSystemUser ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Add-JCSystemUser ---- + + +---- UPDATING Cmdlet : Add-JCUserGroupMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Add-JCUserGroupMember ---- + + +---- UPDATING Cmdlet : Backup-JCOrganization ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Backup-JCOrganization ---- + + +---- UPDATING Cmdlet : Connect-JCOnline ---- + + Parameter Set Added: force + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Connect-JCOnline ---- + + +---- UPDATING Cmdlet : Copy-JCAssociation ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Copy-JCAssociation ---- + + +---- UPDATING Cmdlet : Get-JCAdmin ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCAdmin ---- + + +---- UPDATING Cmdlet : Get-JCAssociation ---- + + Parameter Set Added: ByValue + + Parameter Set Added: Default + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCAssociation ---- + + +---- UPDATING Cmdlet : Get-JCBackup ---- + + Parameter Set Added: None + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCBackup ---- + + +---- UPDATING Cmdlet : Get-JCCloudDirectory ---- + + Parameter Set Added: ReturnAll + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCCloudDirectory ---- + + +---- UPDATING Cmdlet : Get-JCCommand ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCCommand ---- + + +---- UPDATING Cmdlet : Get-JCCommandResult ---- + + Parameter Set Added: ReturnAll + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCCommandResult ---- + + +---- UPDATING Cmdlet : Get-JCCommandTarget ---- + + Parameter Set Added: Systems + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCCommandTarget ---- + + +---- UPDATING Cmdlet : Get-JCConfiguredTemplatePolicy ---- + + Parameter Set Added: ReturnAll + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCConfiguredTemplatePolicy ---- + + +---- UPDATING Cmdlet : Get-JCEvent ---- + + Parameter Added: ExactMatch + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCEvent ---- + + +---- UPDATING Cmdlet : Get-JCEventCount ---- + + Parameter Added: ExactMatch + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCEventCount ---- + + +---- UPDATING Cmdlet : Get-JCGroup ---- + + Parameter Set Added: ReturnAll + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCGroup ---- + + +---- UPDATING Cmdlet : Get-JCOrganization ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCOrganization ---- + + +---- UPDATING Cmdlet : Get-JCPolicy ---- + + Parameter Set Added: ReturnAll + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCPolicy ---- + + +---- UPDATING Cmdlet : Get-JCPolicyGroup ---- + + Parameter Set Added: ReturnAll + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCPolicyGroup ---- + + +---- UPDATING Cmdlet : Get-JCPolicyGroupMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCPolicyGroupMember ---- + + +---- UPDATING Cmdlet : Get-JCPolicyGroupTemplate ---- + + Parameter Set Added: ReturnAll + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCPolicyGroupTemplate ---- + + +---- UPDATING Cmdlet : Get-JCPolicyGroupTemplateMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCPolicyGroupTemplateMember ---- + + +---- UPDATING Cmdlet : Get-JCPolicyResult ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCPolicyResult ---- + + +---- UPDATING Cmdlet : Get-JCPolicyTargetGroup ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCPolicyTargetGroup ---- + + +---- UPDATING Cmdlet : Get-JCPolicyTargetSystem ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCPolicyTargetSystem ---- + + +---- UPDATING Cmdlet : Get-JCRadiusReplyAttribute ---- + + Parameter Set Added: ByGroup + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCRadiusReplyAttribute ---- + + +---- UPDATING Cmdlet : Get-JCRadiusServer ---- + + Parameter Set Added: ByValue + + Parameter Set Added: Default + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCRadiusServer ---- + + +---- UPDATING Cmdlet : Get-JCReport ---- + + Parameter Set Added: List + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCReport ---- + + +---- UPDATING Cmdlet : Get-JCScheduledUserstate ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCScheduledUserstate ---- + + +---- UPDATING Cmdlet : Get-JCSystem ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCSystem ---- + + +---- UPDATING Cmdlet : Get-JCSystemApp ---- + + Parameter Set Added: All + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCSystemApp ---- + + +---- UPDATING Cmdlet : Get-JCSystemGroupMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCSystemGroupMember ---- + + +---- UPDATING Cmdlet : Get-JCSystemInsights ---- + + Parameter Set Added: List + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCSystemInsights ---- + + +---- UPDATING Cmdlet : Get-JCSystemKB ---- + + Parameter Set Added: All + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCSystemKB ---- + + +---- UPDATING Cmdlet : Get-JCSystemUser ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCSystemUser ---- + + +---- UPDATING Cmdlet : Get-JCUser ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCUser ---- + + +---- UPDATING Cmdlet : Get-JCUserGroupMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Get-JCUserGroupMember ---- + + +---- UPDATING Cmdlet : Import-JCCommand ---- + + Parameter Set Added: URL + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Import-JCCommand ---- + + +---- UPDATING Cmdlet : Import-JCMSPFromCSV ---- + + Parameter Set Added: GUI + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Import-JCMSPFromCSV ---- + + +---- UPDATING Cmdlet : Import-JCUsersFromCSV ---- + + Parameter Set Added: GUI + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Import-JCUsersFromCSV ---- + + +---- UPDATING Cmdlet : Invoke-JCCommand ---- + + Parameter Set Added: NoVariables + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Invoke-JCCommand ---- + + +---- UPDATING Cmdlet : Invoke-JCDeployment ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Invoke-JCDeployment ---- + + +---- UPDATING Cmdlet : New-JCCommand ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCCommand ---- + + +---- UPDATING Cmdlet : New-JCDeploymentTemplate ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCDeploymentTemplate ---- + + +---- UPDATING Cmdlet : New-JCDeviceUpdateTemplate ---- + + Parameter Set Added: force + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCDeviceUpdateTemplate ---- + + +---- UPDATING Cmdlet : New-JCImportTemplate ---- + + Parameter Set Added: force + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCImportTemplate ---- + + +---- UPDATING Cmdlet : New-JCMSPImportTemplate ---- + + Parameter Set Added: force + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCMSPImportTemplate ---- + + +---- UPDATING Cmdlet : New-JCPolicy ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCPolicy ---- + + +---- UPDATING Cmdlet : New-JCPolicyGroup ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCPolicyGroup ---- + + +---- UPDATING Cmdlet : New-JCRadiusServer ---- + + Parameter Set Added: ByName + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCRadiusServer ---- + + +---- UPDATING Cmdlet : New-JCReport ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCReport ---- + + +---- UPDATING Cmdlet : New-JCSystemGroup ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCSystemGroup ---- + + +---- UPDATING Cmdlet : New-JCUser ---- + + Parameter Set Added: NoAttributes + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCUser ---- + + +---- UPDATING Cmdlet : New-JCUserGroup ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : New-JCUserGroup ---- + + +---- UPDATING Cmdlet : Remove-JCAssociation ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCAssociation ---- + + +---- UPDATING Cmdlet : Remove-JCCommand ---- + + Parameter Set Added: warn + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCCommand ---- + + +---- UPDATING Cmdlet : Remove-JCCommandResult ---- + + Parameter Set Added: warn + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCCommandResult ---- + + +---- UPDATING Cmdlet : Remove-JCCommandTarget ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCCommandTarget ---- + + +---- UPDATING Cmdlet : Remove-JCGsuiteMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCGsuiteMember ---- + + +---- UPDATING Cmdlet : Remove-JCOffice365Member ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCOffice365Member ---- + + +---- UPDATING Cmdlet : Remove-JCPolicy ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCPolicy ---- + + +---- UPDATING Cmdlet : Remove-JCPolicyGroup ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCPolicyGroup ---- + + +---- UPDATING Cmdlet : Remove-JCPolicyGroupTemplate ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCPolicyGroupTemplate ---- + + +---- UPDATING Cmdlet : Remove-JCRadiusReplyAttribute ---- + + Parameter Set Added: ByGroup + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCRadiusReplyAttribute ---- + + +---- UPDATING Cmdlet : Remove-JCRadiusServer ---- + + Parameter Set Added: ById + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCRadiusServer ---- + + +---- UPDATING Cmdlet : Remove-JCSystem ---- + + Parameter Set Added: warn + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCSystem ---- + + +---- UPDATING Cmdlet : Remove-JCSystemGroup ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCSystemGroup ---- + + +---- UPDATING Cmdlet : Remove-JCSystemGroupMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCSystemGroupMember ---- + + +---- UPDATING Cmdlet : Remove-JCSystemUser ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCSystemUser ---- + + +---- UPDATING Cmdlet : Remove-JCUser ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCUser ---- + + +---- UPDATING Cmdlet : Remove-JCUserGroup ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCUserGroup ---- + + +---- UPDATING Cmdlet : Remove-JCUserGroupMember ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Remove-JCUserGroupMember ---- + + +---- UPDATING Cmdlet : Send-JCPasswordReset ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Send-JCPasswordReset ---- + + +---- UPDATING Cmdlet : Set-JCCloudDirectory ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCCloudDirectory ---- + + +---- UPDATING Cmdlet : Set-JCCommand ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCCommand ---- + + +---- UPDATING Cmdlet : Set-JCOrganization ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCOrganization ---- + + +---- UPDATING Cmdlet : Set-JCPolicy ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCPolicy ---- + + +---- UPDATING Cmdlet : Set-JCPolicyGroup ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCPolicyGroup ---- + + +---- UPDATING Cmdlet : Set-JCRadiusReplyAttribute ---- + + Parameter Set Added: ByGroup + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCRadiusReplyAttribute ---- + + +---- UPDATING Cmdlet : Set-JCRadiusServer ---- + + Parameter Set Added: ByValue + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCRadiusServer ---- + + +---- UPDATING Cmdlet : Set-JCSettingsFile ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCSettingsFile ---- + + +---- UPDATING Cmdlet : Set-JCSystem ---- + + Parameter Set Added: __AllParameterSets + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCSystem ---- + + +---- UPDATING Cmdlet : Set-JCSystemUser ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCSystemUser ---- + + +---- UPDATING Cmdlet : Set-JCUser ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCUser ---- + + +---- UPDATING Cmdlet : Set-JCUserGroupLDAP ---- + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Set-JCUserGroupLDAP ---- + + +---- UPDATING Cmdlet : Update-JCDeviceFromCSV ---- + + Parameter Set Added: GUI + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Update-JCDeviceFromCSV ---- + + +---- UPDATING Cmdlet : Update-JCModule ---- + + Parameter Set Added: CodeArtifact + + Parameter Set Deleted: + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Update-JCModule ---- + + +---- UPDATING Cmdlet : Update-JCMSPFromCSV ---- + + Parameter Set Added: GUI + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Update-JCMSPFromCSV ---- + + +---- UPDATING Cmdlet : Update-JCUsersFromCSV ---- + + Parameter Set Added: GUI + + Parameter Added: ProgressAction + +---- COMPLETED UPDATING Cmdlet : Update-JCUsersFromCSV ---- + + diff --git a/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md b/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md index cb7be978d..f0b2b10b4 100644 --- a/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md +++ b/PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md @@ -14,8 +14,8 @@ Updates the JumpCloud Module Settings File ## SYNTAX ``` -Set-JCSettingsFile [-moduleBannerMessageCount ] - [-parallelOverride ] [-JCEnvironmentLocation ] [] +Set-JCSettingsFile [-parallelOverride ] + [-JCEnvironmentLocation ] [-moduleBannerMessageCount ] [] ``` ## DESCRIPTION diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 85806abb7..c10fd8d29 100644 --- 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 = '2.19.0' +ModuleVersion = '3.0.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 index ababd1aec..999de5378 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 @@ -47,13 +47,6 @@ Function Get-JCEvent { [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])] [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] Param( - [Parameter(Mandatory)] - [JumpCloud.SDK.DirectoryInsights.Category('Uri')] - [System.String] - # Region for JumpCloud API host. - # Use 'api' for US or 'api.eu' for EU. - ${ApiHost}, - [Parameter(ParameterSetName='GetExpanded', Mandatory)] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 index c32c4a8e3..f7dd152de 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 @@ -47,13 +47,6 @@ Function Get-JCEventCount { [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IEventCount])] [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] Param( - [Parameter(Mandatory)] - [JumpCloud.SDK.DirectoryInsights.Category('Uri')] - [System.String] - # Region for JumpCloud API host. - # Use 'api' for US or 'api.eu' for EU. - ${ApiHost}, - [Parameter(ParameterSetName='GetExpanded', Mandatory)] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] diff --git a/PowerShell/JumpCloud Module/Tests/HelperFunctions.ps1 b/PowerShell/JumpCloud Module/Tests/HelperFunctions.ps1 index ce63adfd6..99a7d522d 100755 --- a/PowerShell/JumpCloud Module/Tests/HelperFunctions.ps1 +++ b/PowerShell/JumpCloud Module/Tests/HelperFunctions.ps1 @@ -1,4 +1,4 @@ -Function New-RandomString () { +function New-RandomString () { [CmdletBinding()] param( @@ -13,11 +13,11 @@ Function New-RandomString () { process { $Random = -join ((65..90) + (97..122) | Get-Random -Count $NumberOfChars | ForEach-Object { [char]$_ }) } - end { Return $Random } + end { return $Random } } -Function New-RandomUser () { +function New-RandomUser () { [CmdletBinding(DefaultParameterSetName = 'NoAttributes')] param ( @@ -70,7 +70,7 @@ Function New-RandomUser () { return $NewRandomUser } -Function New-RandomUserCustom () { +function New-RandomUserCustom () { [CmdletBinding(DefaultParameterSetName = 'NoAttributes')] param ( @@ -123,7 +123,7 @@ Function New-RandomUserCustom () { return $NewRandomUser } -Function New-RandomStringLower () { +function New-RandomStringLower () { [CmdletBinding()] param( @@ -137,7 +137,7 @@ Function New-RandomStringLower () { process { $Random = -join ((65..90) + (97..122) | Get-Random -Count $NumberOfChars | ForEach-Object { [char]$_ }) } - end { Return $Random.ToLower() } + end { return $Random.ToLower() } } function Create-RadiusServerTryCatch { diff --git a/PowerShell/JumpCloud Module/Tests/ModuleValidation/HelpFiles.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/ModuleValidation/HelpFiles.Tests.ps1 index b06effc73..ba65a438e 100755 --- a/PowerShell/JumpCloud Module/Tests/ModuleValidation/HelpFiles.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/ModuleValidation/HelpFiles.Tests.ps1 @@ -1,5 +1,5 @@ Describe -Tag:('ModuleValidation') 'Help File Tests' { - Function Get-HelpFilesTestCases { + function Get-HelpFilesTestCases { $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent $ModuleRootFullName = $ModuleRoot.FullName $Regex_FillInThe = '(\{\{)(.*?)(\}\})' @@ -14,11 +14,11 @@ Describe -Tag:('ModuleValidation') 'Help File Tests' { Regex_FillInThePester = $Regex_FillInThePester } } - Return $HelpFilesTestCases + return $HelpFilesTestCases } Context ('Validating help file fields have been populated') { It ('The file "" needs to be populated on line number "" where "" exists.') -TestCases:(Get-HelpFilesTestCases) { - If ($Path) { + if ($Path) { $Path | Should -Not -FileContentMatch ($Regex_FillInThePester) } } @@ -30,7 +30,7 @@ Describe -Tag:('ModuleValidation') 'Help File Tests' { $ModulePathLocation = "$PSScriptRoot/../../../JumpCloud Module" # run the Build-HelpFiles function to generate new docs: Start-Job -Name BuildHelpFiles -ScriptBlock { . $using:BuildHelpFilesLocation -ModuleName "JumpCloud" -ModulePath $using:ModulePathLocation } - Wait-Job -Name BuildHelpFiles + Wait-Job -Name BuildHelpFiles # validate that there's no changes to git diff $ModuleRoot = (Get-Item -Path:($PSScriptRoot)).Parent.Parent @@ -46,7 +46,7 @@ Describe -Tag:('ModuleValidation') 'Help File Tests' { Test-Path -Path $_.FullName | Should -Be $true # Git Diff for the file should not exist - $diff = git diff -- $_.FullName + $diff = git diff --ignore-cr-at-eol -- $_.FullName if ($diff) { Write-Warning "Diff found in the file $($_.FullName) when we expected none to exist; Please run Build-HelpFiles and commit the results" } diff --git a/PowerShell/JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 index 0e5c468fe..805fbca85 100644 --- a/PowerShell/JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 @@ -1,6 +1,6 @@ Describe -Tag:('ModuleValidation') 'SDK Generation' { - it 'tests that the sdks have been generated before release' { + It 'tests that the sdks have been generated before release' { # run the jcapi to support sync function: . "$PSScriptRoot/../../../Deploy/SdkSync/jcapiToSupportSync.ps1" -RequiredModulesRepo 'PSGallery' # validate that there's no changes to git diff @@ -14,11 +14,11 @@ Describe -Tag:('ModuleValidation') 'SDK Generation' { $functionFilePath = "$FolderPath_Public" -replace "/Public", "$($subitem.Destination)/$($subitem.Name).ps1" $functionFilePath = "$functionFilePath" -replace "JcSdk", "JC" # Each function defined in the jcapiToSupportSync file should exist - Test-Path -Path $functionFilePath | should -Be $true + Test-Path -Path $functionFilePath | Should -Be $true # Git Diff for the file should not exist - $diff = git diff -w $functionFilePath + $diff = git diff --ignore-cr-at-eol -w $functionFilePath if ($diff) { - write-warning "diff found in file: $functionFilePath when we expected none to exist; have you run jcapiToSupportSync.ps1 and committed the resulting changes?" + Write-Warning "diff found in file: $functionFilePath when we expected none to exist; have you run jcapiToSupportSync.ps1 and committed the resulting changes?" } $diff | Should -BeNullOrEmpty } diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 3243aa6f2..22c90d34f 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -5355,6 +5355,18 @@ PS C:\> $BackupJcOrganizationResults.User None + + ExactMatch + + optional string for specifying exact match query, do not use with full text query + + System.String + + System.String + + + None + Fields @@ -5525,6 +5537,18 @@ PS C:\> $BackupJcOrganizationResults.User None + + ExactMatch + + optional string for specifying exact match query, do not use with full text query + + System.String + + System.String + + + None + Fields @@ -5827,6 +5851,18 @@ PS C:\> $BackupJcOrganizationResults.User None + + ExactMatch + + optional string for specifying exact match query, do not use with full text query + + System.String + + System.String + + + None + Fields @@ -5985,6 +6021,18 @@ PS C:\> $BackupJcOrganizationResults.User None + + ExactMatch + + optional string for specifying exact match query, do not use with full text query + + System.String + + System.String + + + None + Fields @@ -6132,7 +6180,7 @@ PS C:\> $BackupJcOrganizationResults.User - System.Int64 + JumpCloud.SDK.DirectoryInsights.Models.IEventCount diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 971882f40..791d7f644 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,4 +1,4 @@ -## 2.19.0 +## 3.0.0 Release Date: December 2, 2025 From 0e71ccbeb1ef0444b0cb7aaa330f5e2a6805e00a Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 2 Dec 2025 10:11:42 -0700 Subject: [PATCH 44/47] skip jcapi gen tests until we fix SDK help gen --- .../JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 index 805fbca85..c0a5786c0 100644 --- a/PowerShell/JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/ModuleValidation/SDKImport.Tests.ps1 @@ -1,6 +1,6 @@ Describe -Tag:('ModuleValidation') 'SDK Generation' { - It 'tests that the sdks have been generated before release' { + It 'tests that the sdks have been generated before release' -Skip { # run the jcapi to support sync function: . "$PSScriptRoot/../../../Deploy/SdkSync/jcapiToSupportSync.ps1" -RequiredModulesRepo 'PSGallery' # validate that there's no changes to git diff From 650e35bbbdc45def0df413985bccaafe9b150834 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 2 Dec 2025 10:11:47 -0700 Subject: [PATCH 45/47] sdk help url --- .../Public/DirectoryInsights/Get-JCEvent.ps1 | 10 +++++----- .../Public/DirectoryInsights/Get-JCEventCount.ps1 | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 index 999de5378..2ce0ac1c0 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 @@ -11,10 +11,10 @@ Query the API for Directory Insights events ``` curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' ``` -.Example -Get-JCEvent -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Limit:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Skip:() -Sort:() -.Example -Get-JCEvent -Body:() +.Example +Get-JCEvent -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Limit:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Skip:() -Sort:() +.Example +Get-JCEvent -Body:() .Inputs JumpCloud.SDK.DirectoryInsights.Models.IEventQuery @@ -41,7 +41,7 @@ BODY : EventQuery is the users' command to search our auth logs [Skip ]: optional offset into the result set to start with when returning [Sort ]: ASC or DESC order for timestamp .Link -https://github.com/TheJumpCloud/jcapi-powershell/tree/CUT-4908_userGroupDeviceGroupFilters/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md #> Function Get-JCEvent { [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])] diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 index f7dd152de..b153d4afe 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 @@ -11,10 +11,10 @@ Query the API for a count of matching events ``` curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events/count' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' ``` -.Example -Get-JCEventCount -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Sort:() -.Example -Get-JCEventCount -Body:() +.Example +Get-JCEventCount -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Sort:() +.Example +Get-JCEventCount -Body:() .Inputs JumpCloud.SDK.DirectoryInsights.Models.IEventQuery @@ -41,7 +41,7 @@ BODY : EventQuery is the users' command to search our auth logs [Skip ]: optional offset into the result set to start with when returning [Sort ]: ASC or DESC order for timestamp .Link -https://github.com/TheJumpCloud/jcapi-powershell/tree/CUT-4908_userGroupDeviceGroupFilters/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md +https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md #> Function Get-JCEventCount { [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IEventCount])] From 31980a891ddd45f3e5d768ec2f60e4b7c0c09b3c Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 2 Dec 2025 11:20:05 -0700 Subject: [PATCH 46/47] remove docs log/ event examples --- PowerShell/JumpCloud Module/.gitignore | 3 +- PowerShell/JumpCloud Module/Docs/PlatyPS.log | 1851 ----------------- .../Public/DirectoryInsights/Get-JCEvent.ps1 | 32 +- .../DirectoryInsights/Get-JCEventCount.ps1 | 16 +- 4 files changed, 46 insertions(+), 1856 deletions(-) delete mode 100644 PowerShell/JumpCloud Module/Docs/PlatyPS.log diff --git a/PowerShell/JumpCloud Module/.gitignore b/PowerShell/JumpCloud Module/.gitignore index 9fa923fdf..80e214b31 100644 --- a/PowerShell/JumpCloud Module/.gitignore +++ b/PowerShell/JumpCloud Module/.gitignore @@ -1 +1,2 @@ -Tests/*-TestResults.xml \ No newline at end of file +Tests/*-TestResults.xml +PlatyPS.log \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Docs/PlatyPS.log b/PowerShell/JumpCloud Module/Docs/PlatyPS.log deleted file mode 100644 index 1e05eb82d..000000000 --- a/PowerShell/JumpCloud Module/Docs/PlatyPS.log +++ /dev/null @@ -1,1851 +0,0 @@ - -[Update-MarkdownHelpModule] 09/17/2020 09:16:03 Determined module name for 'C:\Users\epanipinto\Documents\GitHub\support\PowerShell\JumpCloud Module/Docs' as 'JumpCloud'. -[Update-MarkdownHelpModule] 09/17/2020 09:16:03 [Update-MarkdownHelpModule]9/17/2020 09:16:03 -[Update-MarkdownHelpModule] 09/17/2020 09:16:03 Updating documents for module 'JumpCloud' in C:\Users\epanipinto\Documents\GitHub\support\PowerShell\JumpCloud Module/Docs ----- UPDATING Cmdlet : Add-JCAssociation ---- - - Parameter Updated: Attributes - Position updated from 12 to - - Parameter Updated: Id - Position updated from 1 to - - Parameter Updated: Name - Position updated from 1 to - - Parameter Updated: TargetId - Position updated from 10 to - - Parameter Updated: TargetName - Position updated from 11 to - - Parameter Updated: TargetType - Position updated from 2 to - - Parameter Updated: Type - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Add-JCAssociation ---- - - ----- UPDATING Cmdlet : Add-JCCommandTarget ---- - - Parameter Updated: CommandID - Position updated from 0 to 1 - - Parameter Updated: GroupID - Position updated from 1 to 2 - - Parameter Updated: GroupName - Position updated from 1 to 2 - - Parameter Updated: SystemID - Position updated from 1 to 2 - ----- COMPLETED UPDATING Cmdlet : Add-JCCommandTarget ---- - - ----- UPDATING Cmdlet : Add-JCRadiusReplyAttribute ---- - - Parameter Set Added: ByGroup - - Parameter Set Deleted: - - Parameter Set Name Updated: ByGroup - Old Set: - New Set: ByGroup - - Parameter Updated: Attribute1_name - Position updated from Named to - - Parameter Updated: Attribute1_value - Position updated from Named to - - Parameter Updated: Attribute2_name - Position updated from Named to - - Parameter Updated: Attribute2_value - Position updated from Named to - - Parameter Updated: GroupName - Position updated from 0 to 1 - - Parameter Updated: VLANTag - Position updated from Named to - ----- COMPLETED UPDATING Cmdlet : Add-JCRadiusReplyAttribute ---- - - ----- UPDATING Cmdlet : Add-JCSystemGroupMember ---- - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Add-JCSystemGroupMember ---- - - ----- UPDATING Cmdlet : Add-JCSystemUser ---- - - Parameter Updated: Administrator - Position updated from Named to 3 - - Parameter Updated: SystemID - Position updated from Named to 2 - - Parameter Updated: Username - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Add-JCSystemUser ---- - - ----- UPDATING Cmdlet : Add-JCUserGroupMember ---- - - Parameter Updated: GroupName - Position updated from 0 to 1 - - Parameter Updated: Username - Position updated from 1 to 2 - ----- COMPLETED UPDATING Cmdlet : Add-JCUserGroupMember ---- - - ----- UPDATING Cmdlet : Connect-JCOnline ---- - - Parameter Set Added: force - - Parameter Set Deleted: - - Parameter Set Name Updated: force - Old Set: - New Set: force - - Parameter Updated: JCEnvironment - Position updated from 3 to - - Parameter Updated: JumpCloudApiKey - Position updated from 1 to - - Parameter Updated: JumpCloudOrgId - Position updated from 2 to - ----- COMPLETED UPDATING Cmdlet : Connect-JCOnline ---- - - ----- UPDATING Cmdlet : Copy-JCAssociation ---- - - Parameter Updated: ExcludeType - Position updated from 15 to - - Parameter Updated: Id - Position updated from 1 to - - Parameter Updated: IncludeType - Position updated from 14 to - - Parameter Updated: Name - Position updated from 1 to - - Parameter Updated: RemoveExisting - Position updated from 13 to - - Parameter Updated: TargetId - Position updated from 10 to - - Parameter Updated: TargetName - Position updated from 11 to - - Parameter Updated: Type - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Copy-JCAssociation ---- - - ----- UPDATING Cmdlet : Get-JCAssociation ---- - - Parameter Set Added: ByValue - - Parameter Set Added: Default - - Parameter Updated: Direct - Position updated from 5 to - - Parameter Updated: Fields - Position updated from 95 to - - Parameter Updated: Id - Position updated from 1 to - - Parameter Updated: IncludeInfo - Position updated from 7 to - - Parameter Updated: IncludeNames - Position updated from 8 to - - Parameter Updated: IncludeVisualPath - Position updated from 9 to - - Parameter Updated: Indirect - Position updated from 6 to - - Parameter Updated: Limit - Position updated from 97 to - - Parameter Updated: Name - Position updated from 1 to - - Parameter Updated: Paginate - Position updated from 99 to - - Parameter Updated: Skip - Position updated from 98 to - - Parameter Updated: TargetType - Position updated from 2 to - - Parameter Updated: Type - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCAssociation ---- - - ----- UPDATING Cmdlet : Get-JCBackup ---- - - Parameter Set Added: None - - Parameter Set Deleted: - - Parameter Set Name Updated: None - Old Set: - New Set: None - ----- COMPLETED UPDATING Cmdlet : Get-JCBackup ---- - - ----- UPDATING Cmdlet : Get-JCCommand ---- - - Parameter Set Added: ReturnAll - - Parameter Updated: CommandID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCCommand ---- - - ----- UPDATING Cmdlet : Get-JCCommandResult ---- - - Parameter Updated: CommandResultID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCCommandResult ---- - - ----- UPDATING Cmdlet : Get-JCCommandTarget ---- - - Parameter Set Added: Systems - - Parameter Updated: CommandID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCCommandTarget ---- - - ----- UPDATING Cmdlet : Get-JCEvent ---- - - No updates done - ----- COMPLETED UPDATING Cmdlet : Get-JCEvent ---- - - ----- UPDATING Cmdlet : Get-JCEventCount ---- - - No updates done - ----- COMPLETED UPDATING Cmdlet : Get-JCEventCount ---- - - ----- UPDATING Cmdlet : Get-JCGroup ---- - - Parameter Set Added: ReturnAll - - Parameter Updated: Name - Position updated from Named to - - Parameter Updated: Type - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCGroup ---- - - ----- UPDATING Cmdlet : Get-JCOrganization ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - ----- COMPLETED UPDATING Cmdlet : Get-JCOrganization ---- - - ----- UPDATING Cmdlet : Get-JCPolicy ---- - - Parameter Set Added: ReturnAll - - Parameter Updated: PolicyID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicy ---- - - ----- UPDATING Cmdlet : Get-JCPolicyResult ---- - - Parameter Updated: PolicyID - Position updated from 0 to 1 - - Parameter Updated: PolicyName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyResult ---- - - ----- UPDATING Cmdlet : Get-JCPolicyTargetGroup ---- - - Parameter Updated: PolicyID - Position updated from 0 to 1 - - Parameter Updated: PolicyName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyTargetGroup ---- - - ----- UPDATING Cmdlet : Get-JCPolicyTargetSystem ---- - - Parameter Updated: PolicyID - Position updated from 0 to 1 - - Parameter Updated: PolicyName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyTargetSystem ---- - - ----- UPDATING Cmdlet : Get-JCRadiusReplyAttribute ---- - - Parameter Set Added: ByGroup - - Parameter Set Deleted: - - Parameter Set Name Updated: ByGroup - Old Set: - New Set: ByGroup - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCRadiusReplyAttribute ---- - - ----- UPDATING Cmdlet : Get-JCRadiusServer ---- - - Parameter Set Added: ByValue - - Parameter Set Added: Default - - Parameter Updated: Fields - Position updated from 95 to - - Parameter Updated: Id - Position updated from 1 to - - Parameter Updated: Limit - Position updated from 97 to - - Parameter Updated: Name - Position updated from 1 to - - Parameter Updated: Paginate - Position updated from 99 to - - Parameter Updated: Skip - Position updated from 98 to - ----- COMPLETED UPDATING Cmdlet : Get-JCRadiusServer ---- - - ----- UPDATING Cmdlet : Get-JCSystem ---- - - Parameter Updated: date - Position updated from Named to - - Parameter Updated: dateFilter - Position updated from Named to - - Parameter Updated: hostname - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCSystem ---- - - ----- UPDATING Cmdlet : Get-JCSystemGroupMember ---- - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCSystemGroupMember ---- - - ----- UPDATING Cmdlet : Get-JCSystemInsights ---- - - Parameter Set Added: List - - Parameter Set Deleted: - - Parameter Set Name Updated: List - Old Set: - New Set: List - ----- COMPLETED UPDATING Cmdlet : Get-JCSystemInsights ---- - - ----- UPDATING Cmdlet : Get-JCSystemUser ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - - Parameter Updated: SystemID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCSystemUser ---- - - ----- UPDATING Cmdlet : Get-JCUser ---- - - Parameter Updated: date - Position updated from Named to - - Parameter Updated: dateFilter - Position updated from Named to - - Parameter Updated: username - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCUser ---- - - ----- UPDATING Cmdlet : Get-JCUserGroupMember ---- - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Get-JCUserGroupMember ---- - - ----- UPDATING Cmdlet : Import-JCCommand ---- - - Parameter Set Added: URL - - Parameter Set Deleted: - - Parameter Set Name Updated: URL - Old Set: - New Set: URL - - Parameter Updated: URL - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Import-JCCommand ---- - - ----- UPDATING Cmdlet : Import-JCUsersFromCSV ---- - - Parameter Set Added: GUI - - Parameter Updated: CSVFilePath - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Import-JCUsersFromCSV ---- - - ----- UPDATING Cmdlet : Invoke-JCCommand ---- - - Parameter Set Added: NoVariables - - Parameter Updated: trigger - Position updated from 0 to 1 - - Parameter Updated: Variable1_name - Position updated from Named to - - Parameter Updated: Variable1_value - Position updated from Named to - - Parameter Updated: Variable2_name - Position updated from Named to - - Parameter Updated: Variable2_value - Position updated from Named to - ----- COMPLETED UPDATING Cmdlet : Invoke-JCCommand ---- - - ----- UPDATING Cmdlet : Invoke-JCDeployment ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - - Parameter Updated: CommandID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Invoke-JCDeployment ---- - - ----- UPDATING Cmdlet : New-JCCommand ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - - Parameter Updated: command - Position updated from 2 to 3 - - Parameter Updated: commandType - Position updated from 1 to 2 - - Parameter Updated: launchType - Position updated from 3 to 4 - - Parameter Updated: name - Position updated from 0 to 1 - - Parameter Updated: shell - Position updated from Named to - - Parameter Updated: timeout - Position updated from 4 to 5 - - Parameter Updated: trigger - Position updated from Named to - - Parameter Updated: user - Position updated from Named to - ----- COMPLETED UPDATING Cmdlet : New-JCCommand ---- - - ----- UPDATING Cmdlet : New-JCDeploymentTemplate ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - ----- COMPLETED UPDATING Cmdlet : New-JCDeploymentTemplate ---- - - ----- UPDATING Cmdlet : New-JCImportTemplate ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - ----- COMPLETED UPDATING Cmdlet : New-JCImportTemplate ---- - - ----- UPDATING Cmdlet : New-JCRadiusServer ---- - - Parameter Set Added: ByName - - Parameter Set Deleted: - - Parameter Set Name Updated: ByName - Old Set: - New Set: ByName - - Parameter Updated: Name - Position updated from 1 to - - Parameter Updated: networkSourceIp - Position updated from 4 to - - Parameter Updated: sharedSecret - Position updated from 5 to - ----- COMPLETED UPDATING Cmdlet : New-JCRadiusServer ---- - - ----- UPDATING Cmdlet : New-JCSystemGroup ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : New-JCSystemGroup ---- - - ----- UPDATING Cmdlet : New-JCUser ---- - - Parameter Set Added: NoAttributes - - Parameter Updated: Attribute1_name - Position updated from Named to - - Parameter Updated: Attribute1_value - Position updated from Named to - - Parameter Updated: Attribute2_name - Position updated from Named to - - Parameter Updated: Attribute2_value - Position updated from Named to - - Parameter Updated: enrollmentDays - Position updated from Named to - ----- COMPLETED UPDATING Cmdlet : New-JCUser ---- - - ----- UPDATING Cmdlet : New-JCUserGroup ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : New-JCUserGroup ---- - - ----- UPDATING Cmdlet : Remove-JCAssociation ---- - - Parameter Updated: Id - Position updated from 1 to - - Parameter Updated: Name - Position updated from 1 to - - Parameter Updated: TargetId - Position updated from 10 to - - Parameter Updated: TargetName - Position updated from 11 to - - Parameter Updated: TargetType - Position updated from 2 to - - Parameter Updated: Type - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCAssociation ---- - - ----- UPDATING Cmdlet : Remove-JCCommand ---- - - Parameter Set Added: warn - - Parameter Updated: CommandID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCCommand ---- - - ----- UPDATING Cmdlet : Remove-JCCommandResult ---- - - Parameter Set Added: warn - - Parameter Updated: CommandResultID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCCommandResult ---- - - ----- UPDATING Cmdlet : Remove-JCCommandTarget ---- - - Parameter Updated: CommandID - Position updated from 0 to 1 - - Parameter Updated: GroupID - Position updated from 1 to 2 - - Parameter Updated: GroupName - Position updated from 1 to 2 - - Parameter Updated: SystemID - Position updated from 1 to 2 - ----- COMPLETED UPDATING Cmdlet : Remove-JCCommandTarget ---- - - ----- UPDATING Cmdlet : Remove-JCRadiusReplyAttribute ---- - - Parameter Set Added: ByGroup - - Parameter Set Deleted: - - Parameter Set Name Updated: ByGroup - Old Set: - New Set: ByGroup - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCRadiusReplyAttribute ---- - - ----- UPDATING Cmdlet : Remove-JCRadiusServer ---- - - Parameter Set Added: ById - - Parameter Set Deleted: - - Parameter Set Name Updated: ById - Old Set: - New Set: ById - - Parameter Updated: Id - Position updated from 1 to - ----- COMPLETED UPDATING Cmdlet : Remove-JCRadiusServer ---- - - ----- UPDATING Cmdlet : Remove-JCSystem ---- - - Parameter Set Added: warn - - Parameter Updated: SystemID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCSystem ---- - - ----- UPDATING Cmdlet : Remove-JCSystemGroup ---- - - Parameter Set Added: warn - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCSystemGroup ---- - - ----- UPDATING Cmdlet : Remove-JCSystemGroupMember ---- - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCSystemGroupMember ---- - - ----- UPDATING Cmdlet : Remove-JCSystemUser ---- - - Parameter Updated: SystemID - Position updated from Named to 2 - - Parameter Updated: Username - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCSystemUser ---- - - ----- UPDATING Cmdlet : Remove-JCUser ---- - - Parameter Updated: Username - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCUser ---- - - ----- UPDATING Cmdlet : Remove-JCUserGroup ---- - - Parameter Set Added: warn - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Remove-JCUserGroup ---- - - ----- UPDATING Cmdlet : Remove-JCUserGroupMember ---- - - Parameter Updated: GroupName - Position updated from 0 to 1 - - Parameter Updated: Username - Position updated from 1 to 2 - ----- COMPLETED UPDATING Cmdlet : Remove-JCUserGroupMember ---- - - ----- UPDATING Cmdlet : Send-JCPasswordReset ---- - - Parameter Updated: UserID - Position updated from 0 to 1 - - Parameter Updated: username - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Send-JCPasswordReset ---- - - ----- UPDATING Cmdlet : Set-JCCommand ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - - Parameter Updated: command - Position updated from 2 to 3 - - Parameter Updated: CommandID - Position updated from 0 to 1 - - Parameter Updated: launchType - Position updated from 3 to 4 - - Parameter Updated: name - Position updated from 1 to 2 - - Parameter Updated: timeout - Position updated from 4 to 5 - - Parameter Updated: trigger - Position updated from Named to - ----- COMPLETED UPDATING Cmdlet : Set-JCCommand ---- - - ----- UPDATING Cmdlet : Set-JCOrganization ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - - Parameter Updated: JumpCloudApiKey - Position updated from 0 to 1 - - Parameter Updated: JumpCloudOrgId - Position updated from 1 to 2 - ----- COMPLETED UPDATING Cmdlet : Set-JCOrganization ---- - - ----- UPDATING Cmdlet : Set-JCRadiusReplyAttribute ---- - - Parameter Set Added: ByGroup - - Parameter Set Deleted: - - Parameter Set Name Updated: ByGroup - Old Set: - New Set: ByGroup - - Parameter Updated: Attribute1_name - Position updated from Named to - - Parameter Updated: Attribute1_value - Position updated from Named to - - Parameter Updated: Attribute2_name - Position updated from Named to - - Parameter Updated: Attribute2_value - Position updated from Named to - - Parameter Updated: GroupName - Position updated from 0 to 1 - - Parameter Updated: VLANTag - Position updated from Named to - ----- COMPLETED UPDATING Cmdlet : Set-JCRadiusReplyAttribute ---- - - ----- UPDATING Cmdlet : Set-JCRadiusServer ---- - - Parameter Set Added: ByValue - - Parameter Updated: Id - Position updated from 1 to - - Parameter Updated: mfa - Position updated from 6 to - - Parameter Updated: Name - Position updated from 1 to - - Parameter Updated: networkSourceIp - Position updated from 4 to - - Parameter Updated: newName - Position updated from 3 to - - Parameter Updated: sharedSecret - Position updated from 5 to - - Parameter Updated: userLockoutAction - Position updated from 7 to - - Parameter Updated: userPasswordExpirationAction - Position updated from 8 to - ----- COMPLETED UPDATING Cmdlet : Set-JCRadiusServer ---- - - ----- UPDATING Cmdlet : Set-JCSystem ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - - Parameter Updated: SystemID - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Set-JCSystem ---- - - ----- UPDATING Cmdlet : Set-JCSystemUser ---- - - Parameter Updated: Administrator - Position updated from Named to 3 - - Parameter Updated: SystemID - Position updated from Named to 2 - - Parameter Updated: Username - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Set-JCSystemUser ---- - - ----- UPDATING Cmdlet : Set-JCUser ---- - - Parameter Updated: Attribute1_name - Position updated from Named to - - Parameter Updated: Attribute1_value - Position updated from Named to - - Parameter Updated: Attribute2_name - Position updated from Named to - - Parameter Updated: Attribute2_value - Position updated from Named to - - Parameter Updated: EnrollmentDays - Position updated from Named to - - Parameter Updated: Username - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Set-JCUser ---- - - ----- UPDATING Cmdlet : Set-JCUserGroupLDAP ---- - - Parameter Updated: GroupID - Position updated from 0 to 1 - - Parameter Updated: GroupName - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Set-JCUserGroupLDAP ---- - - ----- UPDATING Cmdlet : Update-JCModule ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Set Name Updated: __AllParameterSets - Old Set: - New Set: __AllParameterSets - ----- COMPLETED UPDATING Cmdlet : Update-JCModule ---- - - ----- UPDATING Cmdlet : Update-JCUsersFromCSV ---- - - Parameter Set Added: GUI - - Parameter Updated: CSVFilePath - Position updated from 0 to 1 - ----- COMPLETED UPDATING Cmdlet : Update-JCUsersFromCSV ---- - - -[Update-MarkdownHelpModule] 12/02/2025 09:47:21 Determined module name for '/Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Docs' as 'JumpCloud'. -[Update-MarkdownHelpModule] 12/02/2025 09:47:21 [Update-MarkdownHelpModule]12/2/2025 9:47:21 AM -[Update-MarkdownHelpModule] 12/02/2025 09:47:21 Updating documents for module 'JumpCloud' in /Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Docs ----- UPDATING Cmdlet : Add-JCAssociation ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Add-JCAssociation ---- - - ----- UPDATING Cmdlet : Add-JCCommandTarget ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Add-JCCommandTarget ---- - - ----- UPDATING Cmdlet : Add-JCGsuiteMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Add-JCGsuiteMember ---- - - ----- UPDATING Cmdlet : Add-JCOffice365Member ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Add-JCOffice365Member ---- - - ----- UPDATING Cmdlet : Add-JCRadiusReplyAttribute ---- - - Parameter Set Added: ByGroup - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Add-JCRadiusReplyAttribute ---- - - ----- UPDATING Cmdlet : Add-JCSystemGroupMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Add-JCSystemGroupMember ---- - - ----- UPDATING Cmdlet : Add-JCSystemUser ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Add-JCSystemUser ---- - - ----- UPDATING Cmdlet : Add-JCUserGroupMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Add-JCUserGroupMember ---- - - ----- UPDATING Cmdlet : Backup-JCOrganization ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Backup-JCOrganization ---- - - ----- UPDATING Cmdlet : Connect-JCOnline ---- - - Parameter Set Added: force - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Connect-JCOnline ---- - - ----- UPDATING Cmdlet : Copy-JCAssociation ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Copy-JCAssociation ---- - - ----- UPDATING Cmdlet : Get-JCAdmin ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCAdmin ---- - - ----- UPDATING Cmdlet : Get-JCAssociation ---- - - Parameter Set Added: ByValue - - Parameter Set Added: Default - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCAssociation ---- - - ----- UPDATING Cmdlet : Get-JCBackup ---- - - Parameter Set Added: None - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCBackup ---- - - ----- UPDATING Cmdlet : Get-JCCloudDirectory ---- - - Parameter Set Added: ReturnAll - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCCloudDirectory ---- - - ----- UPDATING Cmdlet : Get-JCCommand ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCCommand ---- - - ----- UPDATING Cmdlet : Get-JCCommandResult ---- - - Parameter Set Added: ReturnAll - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCCommandResult ---- - - ----- UPDATING Cmdlet : Get-JCCommandTarget ---- - - Parameter Set Added: Systems - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCCommandTarget ---- - - ----- UPDATING Cmdlet : Get-JCConfiguredTemplatePolicy ---- - - Parameter Set Added: ReturnAll - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCConfiguredTemplatePolicy ---- - - ----- UPDATING Cmdlet : Get-JCEvent ---- - - Parameter Added: ExactMatch - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCEvent ---- - - ----- UPDATING Cmdlet : Get-JCEventCount ---- - - Parameter Added: ExactMatch - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCEventCount ---- - - ----- UPDATING Cmdlet : Get-JCGroup ---- - - Parameter Set Added: ReturnAll - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCGroup ---- - - ----- UPDATING Cmdlet : Get-JCOrganization ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCOrganization ---- - - ----- UPDATING Cmdlet : Get-JCPolicy ---- - - Parameter Set Added: ReturnAll - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicy ---- - - ----- UPDATING Cmdlet : Get-JCPolicyGroup ---- - - Parameter Set Added: ReturnAll - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyGroup ---- - - ----- UPDATING Cmdlet : Get-JCPolicyGroupMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyGroupMember ---- - - ----- UPDATING Cmdlet : Get-JCPolicyGroupTemplate ---- - - Parameter Set Added: ReturnAll - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyGroupTemplate ---- - - ----- UPDATING Cmdlet : Get-JCPolicyGroupTemplateMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyGroupTemplateMember ---- - - ----- UPDATING Cmdlet : Get-JCPolicyResult ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyResult ---- - - ----- UPDATING Cmdlet : Get-JCPolicyTargetGroup ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyTargetGroup ---- - - ----- UPDATING Cmdlet : Get-JCPolicyTargetSystem ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCPolicyTargetSystem ---- - - ----- UPDATING Cmdlet : Get-JCRadiusReplyAttribute ---- - - Parameter Set Added: ByGroup - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCRadiusReplyAttribute ---- - - ----- UPDATING Cmdlet : Get-JCRadiusServer ---- - - Parameter Set Added: ByValue - - Parameter Set Added: Default - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCRadiusServer ---- - - ----- UPDATING Cmdlet : Get-JCReport ---- - - Parameter Set Added: List - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCReport ---- - - ----- UPDATING Cmdlet : Get-JCScheduledUserstate ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCScheduledUserstate ---- - - ----- UPDATING Cmdlet : Get-JCSystem ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCSystem ---- - - ----- UPDATING Cmdlet : Get-JCSystemApp ---- - - Parameter Set Added: All - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCSystemApp ---- - - ----- UPDATING Cmdlet : Get-JCSystemGroupMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCSystemGroupMember ---- - - ----- UPDATING Cmdlet : Get-JCSystemInsights ---- - - Parameter Set Added: List - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCSystemInsights ---- - - ----- UPDATING Cmdlet : Get-JCSystemKB ---- - - Parameter Set Added: All - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCSystemKB ---- - - ----- UPDATING Cmdlet : Get-JCSystemUser ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCSystemUser ---- - - ----- UPDATING Cmdlet : Get-JCUser ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCUser ---- - - ----- UPDATING Cmdlet : Get-JCUserGroupMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Get-JCUserGroupMember ---- - - ----- UPDATING Cmdlet : Import-JCCommand ---- - - Parameter Set Added: URL - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Import-JCCommand ---- - - ----- UPDATING Cmdlet : Import-JCMSPFromCSV ---- - - Parameter Set Added: GUI - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Import-JCMSPFromCSV ---- - - ----- UPDATING Cmdlet : Import-JCUsersFromCSV ---- - - Parameter Set Added: GUI - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Import-JCUsersFromCSV ---- - - ----- UPDATING Cmdlet : Invoke-JCCommand ---- - - Parameter Set Added: NoVariables - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Invoke-JCCommand ---- - - ----- UPDATING Cmdlet : Invoke-JCDeployment ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Invoke-JCDeployment ---- - - ----- UPDATING Cmdlet : New-JCCommand ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCCommand ---- - - ----- UPDATING Cmdlet : New-JCDeploymentTemplate ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCDeploymentTemplate ---- - - ----- UPDATING Cmdlet : New-JCDeviceUpdateTemplate ---- - - Parameter Set Added: force - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCDeviceUpdateTemplate ---- - - ----- UPDATING Cmdlet : New-JCImportTemplate ---- - - Parameter Set Added: force - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCImportTemplate ---- - - ----- UPDATING Cmdlet : New-JCMSPImportTemplate ---- - - Parameter Set Added: force - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCMSPImportTemplate ---- - - ----- UPDATING Cmdlet : New-JCPolicy ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCPolicy ---- - - ----- UPDATING Cmdlet : New-JCPolicyGroup ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCPolicyGroup ---- - - ----- UPDATING Cmdlet : New-JCRadiusServer ---- - - Parameter Set Added: ByName - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCRadiusServer ---- - - ----- UPDATING Cmdlet : New-JCReport ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCReport ---- - - ----- UPDATING Cmdlet : New-JCSystemGroup ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCSystemGroup ---- - - ----- UPDATING Cmdlet : New-JCUser ---- - - Parameter Set Added: NoAttributes - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCUser ---- - - ----- UPDATING Cmdlet : New-JCUserGroup ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : New-JCUserGroup ---- - - ----- UPDATING Cmdlet : Remove-JCAssociation ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCAssociation ---- - - ----- UPDATING Cmdlet : Remove-JCCommand ---- - - Parameter Set Added: warn - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCCommand ---- - - ----- UPDATING Cmdlet : Remove-JCCommandResult ---- - - Parameter Set Added: warn - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCCommandResult ---- - - ----- UPDATING Cmdlet : Remove-JCCommandTarget ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCCommandTarget ---- - - ----- UPDATING Cmdlet : Remove-JCGsuiteMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCGsuiteMember ---- - - ----- UPDATING Cmdlet : Remove-JCOffice365Member ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCOffice365Member ---- - - ----- UPDATING Cmdlet : Remove-JCPolicy ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCPolicy ---- - - ----- UPDATING Cmdlet : Remove-JCPolicyGroup ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCPolicyGroup ---- - - ----- UPDATING Cmdlet : Remove-JCPolicyGroupTemplate ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCPolicyGroupTemplate ---- - - ----- UPDATING Cmdlet : Remove-JCRadiusReplyAttribute ---- - - Parameter Set Added: ByGroup - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCRadiusReplyAttribute ---- - - ----- UPDATING Cmdlet : Remove-JCRadiusServer ---- - - Parameter Set Added: ById - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCRadiusServer ---- - - ----- UPDATING Cmdlet : Remove-JCSystem ---- - - Parameter Set Added: warn - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCSystem ---- - - ----- UPDATING Cmdlet : Remove-JCSystemGroup ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCSystemGroup ---- - - ----- UPDATING Cmdlet : Remove-JCSystemGroupMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCSystemGroupMember ---- - - ----- UPDATING Cmdlet : Remove-JCSystemUser ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCSystemUser ---- - - ----- UPDATING Cmdlet : Remove-JCUser ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCUser ---- - - ----- UPDATING Cmdlet : Remove-JCUserGroup ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCUserGroup ---- - - ----- UPDATING Cmdlet : Remove-JCUserGroupMember ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Remove-JCUserGroupMember ---- - - ----- UPDATING Cmdlet : Send-JCPasswordReset ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Send-JCPasswordReset ---- - - ----- UPDATING Cmdlet : Set-JCCloudDirectory ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCCloudDirectory ---- - - ----- UPDATING Cmdlet : Set-JCCommand ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCCommand ---- - - ----- UPDATING Cmdlet : Set-JCOrganization ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCOrganization ---- - - ----- UPDATING Cmdlet : Set-JCPolicy ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCPolicy ---- - - ----- UPDATING Cmdlet : Set-JCPolicyGroup ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCPolicyGroup ---- - - ----- UPDATING Cmdlet : Set-JCRadiusReplyAttribute ---- - - Parameter Set Added: ByGroup - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCRadiusReplyAttribute ---- - - ----- UPDATING Cmdlet : Set-JCRadiusServer ---- - - Parameter Set Added: ByValue - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCRadiusServer ---- - - ----- UPDATING Cmdlet : Set-JCSettingsFile ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCSettingsFile ---- - - ----- UPDATING Cmdlet : Set-JCSystem ---- - - Parameter Set Added: __AllParameterSets - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCSystem ---- - - ----- UPDATING Cmdlet : Set-JCSystemUser ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCSystemUser ---- - - ----- UPDATING Cmdlet : Set-JCUser ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCUser ---- - - ----- UPDATING Cmdlet : Set-JCUserGroupLDAP ---- - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Set-JCUserGroupLDAP ---- - - ----- UPDATING Cmdlet : Update-JCDeviceFromCSV ---- - - Parameter Set Added: GUI - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Update-JCDeviceFromCSV ---- - - ----- UPDATING Cmdlet : Update-JCModule ---- - - Parameter Set Added: CodeArtifact - - Parameter Set Deleted: - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Update-JCModule ---- - - ----- UPDATING Cmdlet : Update-JCMSPFromCSV ---- - - Parameter Set Added: GUI - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Update-JCMSPFromCSV ---- - - ----- UPDATING Cmdlet : Update-JCUsersFromCSV ---- - - Parameter Set Added: GUI - - Parameter Added: ProgressAction - ----- COMPLETED UPDATING Cmdlet : Update-JCUsersFromCSV ---- - - diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 index 2ce0ac1c0..8b9dde776 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 @@ -12,9 +12,37 @@ Query the API for Directory Insights events curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' ``` .Example -Get-JCEvent -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Limit:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Skip:() -Sort:() +PS C:\> Get-JCEvent -Service:('all') -StartTime:((Get-date).AddDays(-30)) + +Pull all event records from the last thirty days +.Example +PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddHours(-1)) -Limit:('10') + +Get directory results from the last hour limit to the last 10 results in the time range +.Example +PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -Sort:("DESC") -EndTime:((Get-date).AddDays(-5)) + +Get directory results between 30 and 5 days ago, sort timestamp by descending value +.Example +PS C:\> Get-JCEvent -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -Limit:('10') -searchTermAnd:@{"event_type" = "group_create"} + +Get only group_create from the last thirty days .Example -Get-JCEvent -Body:() +PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermOr @{"initiated_by.username" = @("user.1", "user.2")} + +Get login events initiated by either "user.1" or "user.2" between a universal time zone range +.Example +PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "admin_login_attempt"; "resource.email" = "admin.user@adminbizorg.com"} + +Get all events between a date range and match event_type = admin_login_attempt and resource.email = admin.user@adminbizorg.com +.Example +PS C:\> Get-JCEvent -Service:('sso') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"initiated_by.username" = "user.1"} + +Get sso events with the search term initiated_by: username with value "user.1" +.Example +PS C:\> Get-JCEvent -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "organization_update"} + +Get all events filtered by organization_update term between a date range .Inputs JumpCloud.SDK.DirectoryInsights.Models.IEventQuery diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 index b153d4afe..3a09c0a26 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 @@ -12,9 +12,21 @@ Query the API for a count of matching events curl -X POST 'https://api.jumpcloud.com/insights/directory/v1/events/count' -H 'Content-Type: application/json' -H 'x-api-key: REPLACE_KEY_VALUE' --data '{\"service\": [\"all\"], \"start_time\": \"2021-07-14T23:00:00Z\", \"end_time\": \"2021-07-28T14:00:00Z\", \"sort\": \"DESC\", \"fields\": [\"timestamp\", \"event_type\", \"initiated_by\", \"success\", \"client_ip\", \"provider\", \"organization\"]}' ``` .Example -Get-JCEventCount -Service:() -StartTime:() -EndTime:() -ExactMatch:() -Fields:() -Q:() -SearchAfter:() -SearchTermAnd:() -SearchTermNot:() -SearchTermOr:() -Sort:() +PS C:\> Get-JCEventCount -Service:('all') -StartTime:((Get-date).AddDays(-30)) + +Pull all event records from a specified time and count the results +.Example +PS C:\> Get-JCEventCount -Service:('sso') -StartTime:('2020-04-14T00:00:00Z') + +Pull all SSO event records from a specified time and count the results .Example -Get-JCEventCount -Body:() +PS C:\> Get-JCEventCount -Service:('all') -StartTime:('2020-04-14T00:00:00Z') -EndTime:('2020-04-20T23:00:00Z') -SearchTermAnd @{"event_type" = "admin_login_attempt"; "resource.email" = "admin.user@adminbizorg.com"} + +Get all events counts between a date range and match event_type = admin_login_attempt and resource.email = admin.user@adminbizorg.com +.Example +PS C:\> Get-JCEventCount -Service:('directory') -StartTime:((Get-date).AddDays(-30)) -searchTermAnd:@{"event_type" = "group_create"} + +Get only group_create event counts the last thirty days .Inputs JumpCloud.SDK.DirectoryInsights.Models.IEventQuery From fa65af41520da4cab6fedf925d8e8108e0ba2a56 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 2 Dec 2025 15:27:21 -0700 Subject: [PATCH 47/47] settings file set JCEnvironment variable --- PowerShell/JumpCloud Module/JumpCloud.psm1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psm1 b/PowerShell/JumpCloud Module/JumpCloud.psm1 index e602431a7..472790cd3 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psm1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psm1 @@ -12,6 +12,11 @@ foreach ($Import in @($Public + $Private)) { # Check to see if parallel processing is available for the session $global:JCConfig = Get-JCSettingsFile $PSDefaultParameterValues = $global:PSDefaultParameterValues.Clone() +if ($global:JCConfig['JCEnvironment'].Location) { + Write-Host "Setting JCEnvironment to: $($global:JCConfig['JCEnvironment'].Location) from JCModule settings file" -ForegroundColor Green + $env:JCEnvironment = $global:JCConfig['JCEnvironment'].Location +} +# set the JCEnvironment from the settings file if it exists # Set default values for function parameters $PSDefaultParameterValues['Invoke-RestMethod:ContentType'] = 'application/json; charset=utf-8'