Skip to content

Commit

Permalink
Merge pull request #567 from TheJumpCloud/CUT-3935_validateReturnProp…
Browse files Browse the repository at this point in the history
…erties

returnProperties + changelog + version
  • Loading branch information
jworkmanjc authored Apr 3, 2024
2 parents 6b78d7e + f5ac744 commit 8fa2c5a
Show file tree
Hide file tree
Showing 24 changed files with 339 additions and 253 deletions.
6 changes: 4 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Support Code Owners

# PowerShell Module
- @TheJumpCloud/customer-tools

## PowerShell Module & Command Gallery

/PowerShell/ @TheJumpCloud/customer-tools

# Scripts
## Scripts

/scripts/ @TheJumpCloud/customer-tools
1 change: 1 addition & 0 deletions .github/workflows/powershell-module-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ jobs:
'JumpCloud.SDK.V1' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
'JumpCloud.SDK.V2' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
'JumpCloud.SDK.DirectoryInsights' = @{Repository = 'PSGallery'; RequiredVersion = 'latest'}
'powershell-yaml' = @{Repository = 'PSGallery'; RequiredVersion = '0.4.7'}
}
foreach ($RequiredModule in $PSDependencies.Keys) {
Expand Down
222 changes: 111 additions & 111 deletions PowerShell/JumpCloud Module/JumpCloud.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -3,160 +3,160 @@
#
# Generated by: JumpCloud Solutions Architect Team
#
# Generated on: 1/17/2024
# Generated on: 4/02/2024
#

@{

# Script module or binary module file associated with this manifest.
RootModule = 'JumpCloud.psm1'

# Version number of this module.
ModuleVersion = '2.10.0'
# Script module or binary module file associated with this manifest.
RootModule = 'JumpCloud.psm1'

# Version number of this module.
ModuleVersion = '2.10.1'

# Supported PSEditions
# CompatiblePSEditions = @()
# Supported PSEditions
# CompatiblePSEditions = @()

# ID used to uniquely identify this module
GUID = '31c023d1-a901-48c4-90a3-082f91b31646'
# ID used to uniquely identify this module
GUID = '31c023d1-a901-48c4-90a3-082f91b31646'

# Author of this module
Author = 'JumpCloud Solutions Architect Team'
# Author of this module
Author = 'JumpCloud Solutions Architect Team'

# Company or vendor of this module
CompanyName = 'JumpCloud'
# Company or vendor of this module
CompanyName = 'JumpCloud'

# Copyright statement for this module
Copyright = '(c) JumpCloud. All rights reserved.'
# Copyright statement for this module
Copyright = '(c) JumpCloud. All rights reserved.'

# Description of the functionality provided by this module
Description = 'PowerShell functions to manage a JumpCloud Directory-as-a-Service'
# Description of the functionality provided by this module
Description = 'PowerShell functions to manage a JumpCloud Directory-as-a-Service'

# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '4.0'
# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '4.0'

# Name of the PowerShell host required by this module
# PowerShellHostName = ''
# Name of the PowerShell host required by this module
# PowerShellHostName = ''

# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''
# Minimum version of the PowerShell host required by this module
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''
# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# DotNetFrameworkVersion = ''

# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''
# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only.
# ClrVersion = ''

# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''
# Processor architecture (None, X86, Amd64) required by this module
# ProcessorArchitecture = ''

# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @('JumpCloud.SDK.DirectoryInsights',
'JumpCloud.SDK.V1',
'JumpCloud.SDK.V2')
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @('JumpCloud.SDK.DirectoryInsights',
'JumpCloud.SDK.V1',
'JumpCloud.SDK.V2')

# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()
# Assemblies that must be loaded prior to importing this module
# RequiredAssemblies = @()

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
# ScriptsToProcess = @()

# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
# TypesToProcess = @()

# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
# FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()

# Functions 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 functions to export.
FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Add-JCGsuiteMember',
'Add-JCOffice365Member', 'Add-JCRadiusReplyAttribute',
'Add-JCSystemGroupMember', 'Add-JCSystemUser',
'Add-JCUserGroupMember', 'Backup-JCOrganization', 'Connect-JCOnline',
'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup',
'Get-JCCloudDirectory', 'Get-JCCommand', 'Get-JCCommandResult',
'Get-JCCommandTarget', 'Get-JCEvent', 'Get-JCEventCount', 'Get-JCGroup',
'Get-JCOrganization', 'Get-JCPolicy', 'Get-JCPolicyResult',
'Get-JCPolicyTargetGroup', 'Get-JCPolicyTargetSystem',
'Get-JCRadiusReplyAttribute', 'Get-JCRadiusServer', 'Get-JCSystem',
'Get-JCSystemApp', 'Get-JCSystemGroupMember', 'Get-JCSystemInsights',
'Get-JCSystemUser', 'Get-JCUser', 'Get-JCUserGroupMember',
'Import-JCCommand', 'Import-JCMSPFromCSV', 'Import-JCUsersFromCSV',
'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand',
'New-JCDeploymentTemplate', 'New-JCImportTemplate',
'New-JCMSPImportTemplate', 'New-JCPolicy', 'New-JCRadiusServer',
'New-JCSystemGroup', 'New-JCUser', 'New-JCUserGroup',
'Remove-JCAssociation', 'Remove-JCCommand', 'Remove-JCCommandResult',
'Remove-JCCommandTarget', 'Remove-JCGsuiteMember',
'Remove-JCOffice365Member', 'Remove-JCPolicy',
'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer',
'Remove-JCSystem', 'Remove-JCSystemGroup',
'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser',
'Remove-JCUserGroup', 'Remove-JCUserGroupMember',
'Send-JCPasswordReset', 'Set-JCCloudDirectory', 'Set-JCCommand',
'Set-JCOrganization', 'Set-JCPolicy', 'Set-JCRadiusReplyAttribute',
'Set-JCRadiusServer', 'Set-JCSettingsFile', 'Set-JCSystem',
'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP',
'Update-JCModule', 'Update-JCMSPFromCSV', 'Update-JCUsersFromCSV'
# Functions 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 functions to export.
FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Add-JCGsuiteMember',
'Add-JCOffice365Member', 'Add-JCRadiusReplyAttribute',
'Add-JCSystemGroupMember', 'Add-JCSystemUser',
'Add-JCUserGroupMember', 'Backup-JCOrganization', 'Connect-JCOnline',
'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup',
'Get-JCCloudDirectory', 'Get-JCCommand', 'Get-JCCommandResult',
'Get-JCCommandTarget', 'Get-JCEvent', 'Get-JCEventCount', 'Get-JCGroup',
'Get-JCOrganization', 'Get-JCPolicy', 'Get-JCPolicyResult',
'Get-JCPolicyTargetGroup', 'Get-JCPolicyTargetSystem',
'Get-JCRadiusReplyAttribute', 'Get-JCRadiusServer', 'Get-JCSystem',
'Get-JCSystemApp', 'Get-JCSystemGroupMember', 'Get-JCSystemInsights',
'Get-JCSystemUser', 'Get-JCUser', 'Get-JCUserGroupMember',
'Import-JCCommand', 'Import-JCMSPFromCSV', 'Import-JCUsersFromCSV',
'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand',
'New-JCDeploymentTemplate', 'New-JCImportTemplate',
'New-JCMSPImportTemplate', 'New-JCPolicy', 'New-JCRadiusServer',
'New-JCSystemGroup', 'New-JCUser', 'New-JCUserGroup',
'Remove-JCAssociation', 'Remove-JCCommand', 'Remove-JCCommandResult',
'Remove-JCCommandTarget', 'Remove-JCGsuiteMember',
'Remove-JCOffice365Member', 'Remove-JCPolicy',
'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer',
'Remove-JCSystem', 'Remove-JCSystemGroup',
'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser',
'Remove-JCUserGroup', 'Remove-JCUserGroupMember',
'Send-JCPasswordReset', 'Set-JCCloudDirectory', 'Set-JCCommand',
'Set-JCOrganization', 'Set-JCPolicy', 'Set-JCRadiusReplyAttribute',
'Set-JCRadiusServer', 'Set-JCSettingsFile', 'Set-JCSystem',
'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP',
'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 = @()
# 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 = @()

# Variables to export from this module
VariablesToExport = '*'
# Variables to export from this module
VariablesToExport = '*'

# Aliases 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 aliases to export.
AliasesToExport = 'New-JCAssociation'
# Aliases 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 aliases to export.
AliasesToExport = 'New-JCAssociation'

# DSC resources to export from this module
# DscResourcesToExport = @()
# DSC resources to export from this module
# DscResourcesToExport = @()

# List of all modules packaged with this module
# ModuleList = @()
# List of all modules packaged with this module
# ModuleList = @()

# List of all files packaged with this module
# FileList = @()
# List of all files packaged with this module
# FileList = @()

# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
PrivateData = @{

PSData = @{
PSData = @{

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

# A URL to the license for this module.
LicenseUri = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE'
# A URL to the license for this module.
LicenseUri = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE'

# A URL to the main website for this project.
ProjectUri = 'https://github.com/TheJumpCloud/support/wiki'
# A URL to the main website for this project.
ProjectUri = 'https://github.com/TheJumpCloud/support/wiki'

# A URL to an icon representing this module.
IconUri = 'https://avatars1.githubusercontent.com/u/4927461?s=200&v=4'
# A URL to an icon representing this module.
IconUri = 'https://avatars1.githubusercontent.com/u/4927461?s=200&v=4'

# ReleaseNotes of this module
ReleaseNotes = 'https://git.io/jc-pwsh-releasenotes'
# ReleaseNotes of this module
ReleaseNotes = 'https://git.io/jc-pwsh-releasenotes'

# Prerelease string of this module
# Prerelease = ''
# Prerelease string of this module
# Prerelease = ''

# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
# RequireLicenseAcceptance = $false

# External dependent modules of this module
# ExternalModuleDependencies = @()
# External dependent modules of this module
# ExternalModuleDependencies = @()

} # End of PSData hashtable
} # End of PSData hashtable

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

# HelpInfo URI of this module
HelpInfoURI = 'https://github.com/TheJumpCloud/support/wiki'
# HelpInfo URI of this module
HelpInfoURI = 'https://github.com/TheJumpCloud/support/wiki'

# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
# DefaultCommandPrefix = ''

}

Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ Function Get-JCObject {
if ($dirResult.Name -eq $SearchByValueItem) {
# if match on name, just API results to just be the single match
$Result = $dirResult
} elseif ($dirResult.id -eq $SearchByValueItem) {
$Result = $dirResult
} else {
$result = $result | Where-Object { $_ -ne $dirResult }
}
Expand Down
4 changes: 2 additions & 2 deletions PowerShell/JumpCloud Module/Public/Commands/Get-JCCommand.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ Function Get-JCCommand () {
[Parameter( ValueFromPipelineByPropertyName, ParameterSetName = 'SearchFilter', HelpMessage = 'The scheduled command repeat type (minute, hour, day, week, month) of the JumpCloud Command you wish to search for ex. Get-JCCommand -scheduleRepeatType <repeatType>')]
[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''')]
[ValidateSet('command', 'name', 'launchType', 'commandType', 'trigger', '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''')]
[ValidateSet('command', 'name', 'launchType', 'commandType', 'trigger', 'scheduleRepeatType', 'listensTo', 'organization', 'commandRunners', 'schedule', 'shell', 'timeout', 'sudo', 'template', 'scheduleYear', 'timeToLiveSeconds', 'files', 'user', 'systems')]
[String[]]$returnProperties,
[Parameter(Mandatory,
ValueFromPipelineByPropertyName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ function Add-JCGsuiteMember () {
throw "Username: $Username was not found."
}
}
Set-JcSdkGSuiteAssociation -GsuiteId $CloudDirectory.Id -Op 'add' -Type 'user' -Id $UserID -ErrorVariable addError -ErrorAction SilentlyContinue
if ($addError) {
$Status = $addError.ErrorDetails.Message
} else {
try {
Set-JcSdkGSuiteAssociation -GsuiteId $CloudDirectory.Id -Op 'add' -Type 'user' -Id $UserID
$Status = 'Added'
} catch {
$Status = $_.Exception.Message
}
$FormattedResults = [PSCustomObject]@{

Expand All @@ -76,11 +76,11 @@ function Add-JCGsuiteMember () {
throw "Group does not exist. Run 'Get-JCGroup -type User' to see a list of all your JumpCloud user groups."
}
}
Set-JcSdkGSuiteAssociation -GsuiteId $CloudDirectory.Id -Op 'add' -Type 'user_group' -Id $GroupID -ErrorVariable addError -ErrorAction SilentlyContinue
if ($addError) {
$Status = $addError.ErrorDetails.Message
} else {
try {
Set-JcSdkGSuiteAssociation -GsuiteId $CloudDirectory.Id -Op 'add' -Type 'user_group' -Id $GroupID
$Status = 'Added'
} catch {
$Status = $_.Exception.Message
}
$FormattedResults = [PSCustomObject]@{

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ function Add-JCOffice365Member () {
throw "Username: $Username was not found."
}
}
Set-JcSdkOffice365Association -Office365Id $CloudDirectory.Id -Op 'add' -Type 'user' -Id $UserID -ErrorVariable addError -ErrorAction SilentlyContinue
if ($addError) {
$Status = $addError.ErrorDetails.Message
} else {
try {
Set-JcSdkOffice365Association -Office365Id $CloudDirectory.Id -Op 'add' -Type 'user' -Id $UserID
$Status = 'Added'
} catch {
$Status = $_.Exception.Message
}
$FormattedResults = [PSCustomObject]@{

Expand All @@ -76,11 +76,11 @@ function Add-JCOffice365Member () {
throw "Group does not exist. Run 'Get-JCGroup -type User' to see a list of all your JumpCloud user groups."
}
}
Set-JcSdkOffice365Association -Office365Id $CloudDirectory.Id -Op 'add' -Type 'user_group' -Id $GroupID -ErrorVariable addError -ErrorAction SilentlyContinue
if ($addError) {
$Status = $addError.ErrorDetails.Message
} else {
try {
Set-JcSdkOffice365Association -Office365Id $CloudDirectory.Id -Op 'add' -Type 'user_group' -Id $GroupID
$Status = 'Added'
} catch {
$Status = $_.Exception.Message
}
$FormattedResults = [PSCustomObject]@{

Expand Down
Loading

0 comments on commit 8fa2c5a

Please sign in to comment.