Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
1ab3f92
refactor: implement cross-platform path compatibility and add deploy …
junioralmeida-82 May 14, 2026
6048ec3
docs: finalize manifest and changelog for CI validation
junioralmeida-82 May 14, 2026
041f83d
fix: export missing function and fix changelog formatting for CI
junioralmeida-82 May 14, 2026
f3c9ff8
fix: update manifest and changelog date to May 15 for CI validation
junioralmeida-82 May 15, 2026
f46c9c2
fix: adjust manifest date alignment for UTC runner validation
junioralmeida-82 May 15, 2026
6e2d98d
fix: align manifest and changelog dates to May 15 with corrected paths
junioralmeida-82 May 15, 2026
ad11d9a
fix: align manifest date with commit history timezone for CI validation
junioralmeida-82 May 15, 2026
c300f2e
fix: adjust changelog and manifest date formatting for runner validation
junioralmeida-82 May 15, 2026
09969ab
fix: match numeric date format with server commit timestamp
junioralmeida-82 May 15, 2026
515b9b6
fix: match specific string formats expected by module and changelog t…
junioralmeida-82 May 15, 2026
dd644ca
fix: orchestrate help and pester test generation into cross-platform …
junioralmeida-82 May 19, 2026
1e4ba3b
chore: update manifest version for release validation
junioralmeida-82 May 19, 2026
79d729a
chore: commit updated help files and manifest for pipeline validation
junioralmeida-82 May 19, 2026
07d64af
chore: align manifest and changelog release dates to today
junioralmeida-82 May 19, 2026
3cad7fd
fix: remove all ai generated comments and formatting headers
junioralmeida-82 May 20, 2026
fe6a33d
fix: remove ai comments and synchronize release dates to today
junioralmeida-82 May 20, 2026
2de6998
style: enforce OTBS brace formatting and clean up residual comments
junioralmeida-82 May 20, 2026
afc94a0
fix: clear redundant null check flag by bugbot
junioralmeida-82 May 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 48 additions & 3 deletions PowerShell/Deploy/Build-Module.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@ param (
$ReleaseType,
[Parameter()]
[String]
$ModuleName,
$ModuleName = "JumpCloud",
[Parameter()]
[string]
$RequiredModulesRepo,
[Parameter()]
[Boolean]
$ManualModuleVersion
)
. "$PSScriptRoot/Get-Config.ps1" -ModuleName:($ModuleName) -ModuleFolderName:("JumpCloud Module") -DeployFolder:("/PowerShell/Deploy")
# Region: Load Configuration
# Manually define variables to ensure they are passed correctly to the child script on all platforms
$ModuleFolderName = "JumpCloud Module"
$DeployFolder = "/PowerShell/Deploy"

# Resolve the path to Get-Config.ps1 dynamically to handle cross-platform separators
$GetConfigPath = Join-Path -Path $PSScriptRoot -ChildPath "Get-Config.ps1"

# Dot-source the config script with explicit parameters to initialize global variables
. $GetConfigPath -ModuleName $ModuleName -ModuleFolderName $ModuleFolderName -DeployFolder $DeployFolder
# EndRegion: Load Configuration
# Region Checking PowerShell Gallery module version
Write-Host ('[status]Check PowerShell Gallery for module version info')
$PSGalleryInfo = Get-PSGalleryModuleVersion -Name:($ModuleName) -ReleaseType:($RELEASETYPE) #('Major', 'Minor', 'Patch')
Expand Down Expand Up @@ -42,4 +52,39 @@ $NewModuleChangelogRecord = New-ModuleChangelog -LatestVersion:($ModuleVersion)
if (!(($ModuleChangelog | Select-Object -First 1) -match $ModuleVersion)) {
($NewModuleChangelogRecord + ($ModuleChangelog | Out-String)).Trim() | Set-Content -Path:($FilePath_ModuleChangelog) -Force
}
# EndRegion Updating module change log
# EndRegion Updating module change log

Write-Host ('[status] Running synchronized SDK endpoints sync...')
$SdkSyncPath = Join-Path -Path $PSScriptRoot -ChildPath "SdkSync"
$SdkScriptPath = Join-Path -Path $SdkSyncPath -ChildPath "jcapiToSupportSync.ps1"
if (Test-Path $SdkScriptPath) {
& $SdkScriptPath
} else {
Write-Warning "SdkSync script not found at $SdkScriptPath"
}

Write-Host ('[status] Generating Module Help Files...')
$BuildHelpPath = Join-Path -Path $PSScriptRoot -ChildPath "Build-HelpFiles.ps1"
if (Test-Path $BuildHelpPath) {
$ModuleFolder = Split-Path -Parent $FilePath_psd1

$PreviousLocation = Get-Location

Set-Location -Path (Join-Path -Path $ModuleFolder -ChildPath "Docs")

& $BuildHelpPath -ModuleName $ModuleName -ModulePath $ModuleFolder

Set-Location -Path $PreviousLocation
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Set-Location not restored if help script throws

Low Severity

The working directory is changed via Set-Location before calling & $BuildHelpPath, and restored afterward on line 90. If the help script throws a terminating error, Set-Location -Path $PreviousLocation is skipped, leaving the process in the "Docs" directory. Subsequent operations like Build-PesterTestFiles.ps1 would then execute from an unexpected location. A try/finally block would ensure the location is always restored.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 07d64af. Configure here.

} else {
Write-Warning "Build-HelpFiles script not found at $BuildHelpPath"
}

Write-Host ('[status] Autogenerating Pester Test Files...')
$BuildTestsPath = Join-Path -Path $PSScriptRoot -ChildPath "Build-PesterTestFiles.ps1"
if (Test-Path $BuildTestsPath) {
# Called without any parameters, as it discovers the paths on its own.
& $BuildTestsPath
} else {
Write-Warning "Build-PesterTestFiles script not found at $BuildTestsPath"
Comment thread
cursor[bot] marked this conversation as resolved.
Comment thread
cursor[bot] marked this conversation as resolved.
}

4 changes: 2 additions & 2 deletions PowerShell/Deploy/Functions/Invoke-GitCommit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Function Global:Invoke-GitCommit {
Invoke-Git -Arguments:('add -A;')
Invoke-Git -Arguments:('status;')
Invoke-Git -Arguments:('remote;')
Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";')
Invoke-Git -Arguments:('push origin ' + 'master' + ';')
#Invoke-Git -Arguments:('commit -m ' + '"' + $CommitMessage + '";')
#Invoke-Git -Arguments:('push origin ' + 'master' + ';')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Git commit and push permanently disabled in build

Medium Severity

Both git commit and git push commands are commented out, making Invoke-GitCommit a no-op that stages files and shows status but never commits or pushes. While the PR notes this is temporary "until a separate deploy card is addressed," shipping this to the main branch means any CI/CD pipeline depending on this function will silently fail to publish changes.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6048ec3. Configure here.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

git add -A still stages files despite disabled commit

Medium Severity

Invoke-GitCommit still executes git add -A (staging all files), git config user.email, and git config user.name even though commit and push are commented out. When called from Build-WikiPages.ps1, this modifies the developer's local git config to "CircleCI" values and stages their entire working tree — real side effects that conflict with the stated goal of safe local testing. If the intent is to bypass git operations, the staging and config commands need to be disabled too.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit afc94a0. Configure here.

}
}
14 changes: 7 additions & 7 deletions PowerShell/Deploy/Get-Config.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ write-host $ScriptRoot

$FolderPath_ModuleRootPath = (Get-Item -Path:($ScriptRoot)).Directory.parent.FullName
$GitHubWikiUrl = 'https://github.com/TheJumpCloud/support/wiki/'
$FilePath_ModuleChangelog = $FolderPath_ModuleRootPath + '/ModuleChangelog.md'
$FilePath_ModuleChangelog = Join-Path -Path $FolderPath_ModuleRootPath -ChildPath "ModuleChangelog.md"
# Define required files and folders variables
$RequiredFiles = ('LICENSE', 'psm1', 'psd1')
$RequiredFolders = ('Docs', 'Private', 'Public', 'Tests', 'en-US')
# Define folder path variables
$FolderPath_Module = $FolderPath_ModuleRootPath + '/' + $ModuleFolderName
$FolderPath_Module = Join-Path -Path $FolderPath_ModuleRootPath -ChildPath $ModuleFolderName
$RequiredFolders | ForEach-Object {
$FolderName = $_
$FolderPath = $FolderPath_Module + '/' + $FolderName
$FolderPath = Join-Path -Path $FolderPath_Module -ChildPath $FolderName
New-Variable -Name:('FolderName_' + $_.Replace('-', '')) -Value:($FolderName) -Force -Scope Global;
New-Variable -Name:('FolderPath_' + $_.Replace('-', '')) -Value:($FolderPath) -Force -Scope Global
write-host "New Variable: $('FolderPath_' + $_) with value: $($FolderPath)"
Expand All @@ -37,7 +37,7 @@ $RequiredFiles | ForEach-Object {
} Else {
$_
}
$FilePath = $FolderPath_Module + '/' + $FileName
$FilePath = Join-Path -Path $FolderPath_Module -ChildPath $FileName
New-Variable -Name:('FileName_' + $_) -Value:($FileName) -Force -Scope Global;
New-Variable -Name:('FilePath_' + $_) -Value:($FilePath) -Force -Scope Global;
write-host "New Variable: $('FilePath_' + $_) with value: $($FilePath)"
Expand All @@ -47,12 +47,12 @@ $Psd1 = Import-PowerShellDataFile -Path:($FilePath_psd1)
Set-Variable $Psd1 -Scope Global
# Get module function names
$Functions_Public = If (Test-Path -Path:($FolderPath_Public)) {
Get-ChildItem -Path:($FolderPath_Public + '/' + '*.ps1') -Recurse
Get-ChildItem -Path (Join-Path -Path $FolderPath_Public -ChildPath "*.ps1") -Recurse
}
Set-Variable $Functions_Public -Scope Global
$Functions_Private = If (Test-Path -Path:($FolderPath_Private)) {
Get-ChildItem -Path:($FolderPath_Private + '/' + '*.ps1') -Recurse
Get-ChildItem -Path (Join-Path -Path $FolderPath_Private -ChildPath "*.ps1") -Recurse
}

# Setup-Dependencies.ps1
.("$PSScriptRoot/Setup-Dependencies.ps1") -RequiredModulesRepo:('PSGallery')
. (Join-Path -Path $PSScriptRoot -ChildPath "Setup-Dependencies.ps1") -RequiredModulesRepo:('PSGallery')
29 changes: 29 additions & 0 deletions PowerShell/Deploy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Execution Commands
Run the build script from the root of the repository using pwsh to generate a new version (Patch, Minor, or Major):

On Windows:

PowerShell
pwsh ./PowerShell/Deploy/Build-Module.ps1 -ReleaseType Patch
On macOS / Linux:

Bash
pwsh ./PowerShell/Deploy/Build-Module.ps1 -ReleaseType Patch
🛠️ Script Architecture
Get-Config.ps1: The configuration engine. It dynamically builds all file and folder paths using Join-Path to ensure correct path separators (/ vs \) based on the Operating System.

Build-Module.ps1: The orchestrator. It manages the build workflow, updates the module manifest (.psd1), and handles the changelog.

Functions/: Contains modularized logic for Git operations, manifest creation, and logging.

Cross-Platform Compatibility
The build system has been modernized to eliminate hardcoded path strings:

Windows (PS 5.1 & 7): Paths resolve using backslashes (e.g., C:\\Workspace\\...).

macOS / Linux: Paths resolve using forward slashes (e.g., /Users/name/...).

Parameter Passing: The orchestrator uses robust variable initialization to prevent "Null Argument" errors across different PowerShell versions.

Safety Note (ATENTION)
The Invoke-GitCommit.ps1 script has been updated to bypass automatic git push during local testing to prevent accidental commits to the master branch.
2 changes: 1 addition & 1 deletion PowerShell/JumpCloud Module/Docs/JumpCloud.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: 3.1.0
Help Version: 3.1.1
Locale: en-Us
---

Expand Down
4 changes: 2 additions & 2 deletions PowerShell/JumpCloud Module/Docs/Set-JCSettingsFile.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Updates the JumpCloud Module Settings File
## SYNTAX

```
Set-JCSettingsFile [-JCEnvironmentLocation <PSObject>]
[-parallelOverride <PSObject>] [-moduleBannerMessageCount <PSObject>] [<CommonParameters>]
Set-JCSettingsFile [-moduleBannerMessageCount <PSObject>]
[-JCEnvironmentLocation <PSObject>] [-parallelOverride <PSObject>] [<CommonParameters>]
```

## DESCRIPTION
Expand Down
20 changes: 10 additions & 10 deletions PowerShell/JumpCloud Module/JumpCloud.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Generated by: JumpCloud Solutions Architect Team
#
# Generated on: 5/12/2026
# Generated on: 05/20/2026
#

@{
Expand All @@ -12,7 +12,7 @@
RootModule = 'JumpCloud.psm1'

# Version number of this module.
ModuleVersion = '3.1.0'
ModuleVersion = '3.1.1'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -103,12 +103,12 @@ FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Add-JCGsuiteMem
'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser',
'Remove-JCUserGroup', 'Remove-JCUserGroupMember',
'Send-JCPasswordReset', 'Set-JCCloudDirectory', 'Set-JCCommand',
'Set-JCOrganization', 'Set-JCPolicy', 'Set-JCPolicyGroupMember',
'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer',
'Set-JCSettingsFile', 'Set-JCSystem', 'Set-JCSystemUser', 'Set-JCUser',
'Set-JCUserGroupLDAP', 'Update-JCDeviceFromCSV', 'Update-JCModule',
'Update-JCMSPFromCSV', 'Update-JCUsersFromCSV', 'Set-JCUserGroup',
'Set-JCSystemGroup', 'Set-JCPolicyGroup'
'Set-JCOrganization', 'Set-JCPolicy', 'Set-JCPolicyGroup',
'Set-JCPolicyGroupMember', 'Set-JCRadiusReplyAttribute',
'Set-JCRadiusServer', 'Set-JCSettingsFile', 'Set-JCSystem',
'Set-JCSystemGroup', 'Set-JCSystemUser', 'Set-JCUser',
'Set-JCUserGroup', 'Set-JCUserGroupLDAP', 'Update-JCDeviceFromCSV',
'Update-JCModule', 'Update-JCMSPFromCSV', 'Update-JCUsersFromCSV'

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
CmdletsToExport = @()
Expand All @@ -134,7 +134,7 @@ PrivateData = @{
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'JumpCloud','DaaS','Jump','Cloud','Directory'
Tags = 'JumpCloud', 'DaaS', 'Jump', 'Cloud', 'Directory'

# A URL to the license for this module.
LicenseUri = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE'
Expand All @@ -159,7 +159,7 @@ PrivateData = @{

} # End of PSData hashtable

} # End of PrivateData hashtable
} # End of PrivateData hashtable

# HelpInfo URI of this module
HelpInfoURI = 'https://github.com/TheJumpCloud/support/wiki'
Expand Down
27 changes: 27 additions & 0 deletions PowerShell/ModuleChangelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
## 3.1.1

Release Date: May 20, 2026

### RELEASE NOTES

- Refactored build scripts to ensure full cross-platform compatibility (macOS, Linux, and Windows)
- Standardized path resolution using `Join-Path` and dynamic `$PSScriptRoot` references
- Improved variable initialization during the build process to prevent null reference errors in non-Windows environments
- Added deployment documentation (`README.md`) to the `PowerShell/Deploy` directory

### FEATURES

- Added macOS and Linux support to the JumpCloud module deployment pipeline

### IMPROVEMENTS

- Replaced hardcoded backslash path separators with system-agnostic `Join-Path` logic
- Standardized dot-sourcing of configuration scripts with explicit parameter passing

### BUG FIXES

- Fixed "Argument is null or empty" errors occurring during build execution on macOS/Linux
- Resolved directory resolution failures in CI/CD environments (GitHub Actions)

---

## 3.1.0

Release Date: May 12, 2026
Expand Down
Loading