Skip to content

Cut 5114 reg import update data type#739

Merged
jworkmanjc merged 12 commits into
v3.1.0_pwshModulefrom
CUT-5114_regImportUpdateDataType
May 8, 2026
Merged

Cut 5114 reg import update data type#739
jworkmanjc merged 12 commits into
v3.1.0_pwshModulefrom
CUT-5114_regImportUpdateDataType

Conversation

@jworkmanjc
Copy link
Copy Markdown
Contributor

@jworkmanjc jworkmanjc commented May 6, 2026

Issues

  • CUT-5114 - Update .reg file import for JCPolicy

What does this solve?

This release addresses an issue with the JumpCloud Registry Policy for Windows devices. Previously when creating a new policy from a registry .reg file, the New-JCPolicy function would call our private function Convert-RegToPSObject.ps1 and in doing so would import int type DWORDS as int type values. This change explicitly casts these values as string type values.

When these fields were cast as int types, the JumpCloud Agent would fail to apply the policy based on it's own validation of the registry entry. Now when creating policies DWORD type values are cast as strings regardless of their type and they are able to successfully deployed to devices.

Is there anything particularly tricky?

N/A

How should this be tested?

Save this file as a .reg file somewhere on your desktop:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\WindowsFirewall\DomainProfile]
"EnableFirewall"=dword:00000000

Using the latest production version of the JumpCloud PowerShell Module, create a new policy using this .reg file and New-JCPolicy

New-JCPolicy -TemplateName windows_Advanced:_Custom_Registry_Keys -RegistryFile "~/Documents/registry.reg" -Name "(Testing) Windows Firewall Policy"

This should create a new policy in JumpCloud, assign this policy to a windows device, it should fail.

Error on JumpCloud Console:
Screenshot 2026-05-06 at 3 14 23 PM

Error on jcagent.log
Screenshot 2026-05-06 at 3 16 47 PM

In a new PWSH session, import the development version of the PowerShell module:
Import-Module "~/Documents/GitHub/support/PowerShell/JumpCloud Module/JumpCloud.psd1" -force

Create the policy from the same file using a different name:
New-JCPolicy -TemplateName windows_Advanced:_Custom_Registry_Keys -RegistryFile "~/Documents/registry.reg" -Name "(Testing) Windows Firewall Policy -latest"

Apply that policy to the same device, it should now apply correctly:
Screenshot 2026-05-06 at 3 19 43 PM

Screenshots

In previous versions of Convert-RegToPSObject.ps1 some registry values would fail to apply and show this error in the jcagent.log file:
image


Note

Medium Risk
Changes the registry .reg import serialization for New-JCPolicy/Set-JCPolicy, which can affect how Windows registry policies are applied and may alter existing expectations around numeric types/edge cases (e.g., zero and 64-bit ranges). Test updates reduce regression risk but behavior changes are user-visible.

Overview
Fixes Windows custom registry policy creation from .reg files by changing Convert-RegToPSObject to emit DWORD and QWORD values as decimal strings (using uint32/uint64 parsing) instead of PowerShell integers, and adds safer handling for all-zero QWORD inputs.

Updates the Pester tests to assert the new string-typed customData for DWORD/QWORD, and refreshes the module manifest/changelog release dates to reflect the cut.

Reviewed by Cursor Bugbot for commit 5995a87. Bugbot is set up for automated code reviews on this repo. Configure here.

@jworkmanjc jworkmanjc added minor minor version release PowerShell Module Release for JumpCloud PowerShell Module labels May 6, 2026
@jworkmanjc jworkmanjc marked this pull request as ready for review May 6, 2026 20:56
@jworkmanjc jworkmanjc requested a review from a team as a code owner May 6, 2026 20:56
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit d19bd23. Configure here.

Comment thread PowerShell/JumpCloud Module/JumpCloud.psd1 Outdated
Copy link
Copy Markdown
Contributor

@junioralmeida-82 junioralmeida-82 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. Verified the 4 files changed and they correctly address the alias fixes and documentation updates for the v3.1.0 release. Great work on the rebase.

@jworkmanjc jworkmanjc merged commit 5387ca5 into v3.1.0_pwshModule May 8, 2026
11 of 13 checks passed
@jworkmanjc jworkmanjc deleted the CUT-5114_regImportUpdateDataType branch May 8, 2026 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

minor minor version release PowerShell Module Release for JumpCloud PowerShell Module

Development

Successfully merging this pull request may close these issues.

2 participants