Skip to content

Commit

Permalink
Merge pull request #356 from TheJumpCloud/JumpCloudModule_1.19.0
Browse files Browse the repository at this point in the history
Jump cloud module 1.19.0
  • Loading branch information
jworkmanjc authored Mar 8, 2022
2 parents 1b28d75 + 4e732ab commit 8644a65
Show file tree
Hide file tree
Showing 43 changed files with 1,571 additions and 298 deletions.
36 changes: 20 additions & 16 deletions .circleci/workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ parameters:
description: 'Release Type. Accepted values [ Major, Minor, Patch ]'
type: enum
enum: ["Major", "Minor", "Patch"]
default: "Patch"
default: "Minor"
RequiredModulesRepo:
description: 'PowerShell Repository for JumpCloud SDKs'
type: enum
Expand All @@ -45,17 +45,18 @@ parameters:
PublishToPSGallery:
description: 'When `true` and when run against Master branch, this workflow will publish the latest code to PSGallery'
type: boolean
default: false
default: true
ManualModuleVersion:
description: 'When `true` the pipeline will use the Module Version specified in JumpCloud Module JumpCloud.psd1 file'
type: boolean
default: false
orbs:
win: circleci/windows@2.2.0
win: circleci/windows@2.4.1
executors:
macos_exec:
macos:
xcode: 11.3.0
xcode: 13.2.1
resource_class: macos.x86.medium.gen2
workflows:
version: 2
ci:
Expand Down Expand Up @@ -204,7 +205,7 @@ jobs:
- invoke-pester:
JumpCloudApiKey: $env:XAPIKEY_PESTER
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP
ExcludeTagList: 'ModuleValidation, JCUsersFromCSV, JCDeployment, JCModule'
ExcludeTagList: 'ModuleValidation, JCDeployment'
IncludeTagList: '*'
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >>
Shell: 'pwsh.exe'
Expand All @@ -215,25 +216,25 @@ jobs:
- invoke-pester:
JumpCloudApiKey: $env:XAPIKEY_PESTER_MAC
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP
ExcludeTagList: 'ModuleValidation, JCUsersFromCSV, JCDeployment, JCModule'
ExcludeTagList: 'ModuleValidation, JCDeployment'
IncludeTagList: '*'
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >>
Shell: 'pwsh'
Pester Tests Linux:
machine:
image: ubuntu-1604:202007-01
image: ubuntu-2004:202201-02
steps:
- setup-pester-env-linux
- invoke-pester:
JumpCloudApiKey: $env:XAPIKEY_PESTER_LINUX
JumpCloudApiKeyMsp: $env:XAPIKEY_PESTER_MTP
ExcludeTagList: 'ModuleValidation, JCUsersFromCSV, JCDeployment, JCModule'
ExcludeTagList: 'ModuleValidation, JCDeployment'
IncludeTagList: '*'
RequiredModulesRepo: << pipeline.parameters.RequiredModulesRepo >>
Shell: 'pwsh'
Publish Module Validation:
machine:
image: ubuntu-1604:202007-01
image: ubuntu-2004:202201-02
steps:
- validate-pipeline-param:
branch: << pipeline.git.branch >>
Expand Down Expand Up @@ -263,12 +264,15 @@ jobs:
- run:
name: "Draft Release on GitHub"
command: |
VERSION=$(grep -o '\d\+\.\d\+\.\d' /root/project/PowerShell/JumpCloud\ Module/JumpCloud.psd1)
TITLE="JumpCloudModule_$VERSION"
VERSION="v$VERSION"
BODY="Latest Release of JumpCloud PowerShell Module"
#TODO: implement TITLE & BODY later, for some reason these params don't work
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete -draft ${VERSION} /root/project/PowerShell/
# Module Version
VERSION=$(grep -o '\d\+\.\d\+\.\d\+' /root/project/PowerShell/JumpCloud\ Module/JumpCloud.psd1)
TITLE="JumpCloud PowerShell Module v$VERSION"
# Get the changelog text between the latest release # and the next sequential "## SemanticVersionNumber"
CHANGELOG=$(cat /root/project/PowerShell/ModuleChangelog.md |awk "/^## $VERSION/{ f = 1; next } /## [0-9]+.[0-9]+.[0-9]+/{ f = 0 } f")
TAG="v$VERSION"
BODY="$TITLE $CHANGELOG"
# Post Draft Release
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -n "$TITLE" -b "$BODY" -delete -draft "$TAG" /root/project/PowerShell/
commands:
initial-setup:
steps:
Expand Down Expand Up @@ -527,4 +531,4 @@ commands:
- persist_to_workspace:
root: .
paths:
- .
- .
15 changes: 12 additions & 3 deletions PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ $ApprovedFunctions = [Ordered]@{
$SdkPrefix = 'JcSdk'
$JumpCloudModulePrefix = 'JC'
$IndentChar = ' '
$MSCopyrightHeader = "`n# ----------------------------------------------------------------------------------`n#`n# Copyright Microsoft Corporation`n# Licensed under the Apache License, Version 2.0 (the ""License"");`n# you may not use this file except in compliance with the License.`n# You may obtain a copy of the License at`n# http://www.apache.org/licenses/LICENSE-2.0`n# Unless required by applicable law or agreed to in writing, software`n# distributed under the License is distributed on an ""AS IS"" BASIS,`n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.`n# See the License for the specific language governing permissions and`n# limitations under the License.`n# ----------------------------------------------------------------------------------`n"
$Divider = '|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|'
$MSCopyrightHeader = "`n<#`n.Synopsis`n"
$Divider = "`n[SPLIT]`n<#`n.Synopsis`n"
$FunctionTemplate = "{0}`nFunction {1}`n{{`n$($IndentChar){2}`n$($IndentChar)Param(`n{3}`n$($IndentChar))`n$($IndentChar)Begin`n$($IndentChar){{`n{4}`n$($IndentChar)}}`n$($IndentChar)Process`n$($IndentChar){{`n{5}`n$($IndentChar)}}`n$($IndentChar)End`n$($IndentChar){{`n{6}`n$($IndentChar)}}`n}}"
$ScriptAnalyzerResults = @()
$JumpCloudModulePath = "$PSScriptRoot/../JumpCloud Module"
Expand Down Expand Up @@ -102,7 +102,16 @@ If (-not [System.String]::IsNullOrEmpty($Modules))
<# 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. #>
$CommandFilePathContent.Replace($MSCopyrightHeader, $Divider).Split($Divider) | Where-Object { $_ -like ('*' + "function $CommandName {" + '*') }
$ProxyContent = $CommandFilePathContent.Replace($MSCopyrightHeader, $Divider)
$ProxyContentSplit = $ProxyContent.Split("[SPLIT]")
foreach ($functionSplit in $ProxyContentSplit)
{
if ($functionSplit -match "function $CommandName {")
{
# return the matched content
$functionSplit
}
}
}
Else
{
Expand Down
2 changes: 1 addition & 1 deletion PowerShell/Deploy/Setup-Dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ If (-not [System.String]::IsNullOrEmpty($Psd1))
# Set Module Path from required Module
$ModulePath = "$($LocalPSModulePath)/$($RequiredModule)"
# Search for module in localPSModulePath
$moduleFound = Get-InstalledPSResource -name $RequiredModule -path $LocalPSModulePath
$moduleFound = Get-PSResource -name $RequiredModule -path $LocalPSModulePath
if ([string]::isnullorempty($moduleFound)) {
# Install module if it does not exist
Install-PSResource -Name:($RequiredModule) -Repository:($RequiredModulesRepo) -Credential:($RepositoryCredentials) -Prerelease -Scope 'CurrentUser';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ Specifies the VLAN id which is applied to all attribute names.
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
Accepted values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31

Required: False
Position: Named
Expand Down
1 change: 0 additions & 1 deletion PowerShell/JumpCloud Module/Docs/Get-JCEvent.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem
### System.String
## NOTES
COMPLEX PARAMETER PROPERTIES
To create the parameters described below, construct a hash table containing the appropriate properties.
Expand Down
1 change: 0 additions & 1 deletion PowerShell/JumpCloud Module/Docs/Get-JCEventCount.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
## OUTPUTS
### System.Int64
### System.String
## NOTES
COMPLEX PARAMETER PROPERTIES
Expand Down
36 changes: 33 additions & 3 deletions PowerShell/JumpCloud Module/Docs/Get-JCUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Get-JCUser [[-username] <String>] [-firstname <String>] [-lastname <String>] [-e
[-filterDateProperty <String>] [-returnProperties <String[]>] [-middlename <String>] [-displayname <String>]
[-jobTitle <String>] [-employeeIdentifier <String>] [-department <String>] [-costCenter <String>]
[-company <String>] [-employeeType <String>] [-description <String>] [-location <String>]
[-external_dn <String>] [-external_source_type <String>] -dateFilter <String> -date <DateTime>
[<CommonParameters>]
[-external_dn <String>] [-external_source_type <String>] [-managedAppleId <String>] [-manager <String>]
-dateFilter <String> -date <DateTime> [<CommonParameters>]
```

### ByID
Expand Down Expand Up @@ -438,6 +438,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -managedAppleId
The managedAppleId of the JumpCloud user you wish to search for.
```yaml
Type: System.String
Parameter Sets: SearchFilter
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -manager
The manager of the JumpCloud user you wish to search for.
```yaml
Type: System.String
Parameter Sets: SearchFilter
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -middlename
The middlename of the JumpCloud user you wish to search for.
Expand Down Expand Up @@ -507,7 +537,7 @@ Valid properties that can be returned are: 'created', 'password_expiration_date'
Type: System.String[]
Parameter Sets: SearchFilter
Aliases:
Accepted values: created, password_expiration_date, account_locked, activated, addresses, allow_public_key, attributes, email, enable_managed_uid, enable_user_portal_multifactor, externally_managed, firstname, lastname, ldap_binding_user, passwordless_sudo, password_expired, password_never_expires, phoneNumbers, samba_service_user, ssh_keys, sudo, totp_enabled, unix_guid, unix_uid, username, middlename, displayname, jobTitle, employeeIdentifier, department, costCenter, company, employeeType, description, location, external_source_type, external_dn, suspended, mfa
Accepted values: created, password_expiration_date, account_locked, activated, addresses, allow_public_key, attributes, alternateEmail, managedAppleId, manager, email, enable_managed_uid, enable_user_portal_multifactor, externally_managed, firstname, lastname, ldap_binding_user, passwordless_sudo, password_expired, password_never_expires, phoneNumbers, samba_service_user, ssh_keys, sudo, totp_enabled, unix_guid, unix_uid, username, middlename, displayname, jobTitle, employeeIdentifier, department, costCenter, company, employeeType, description, location, external_source_type, external_dn, suspended, mfa

Required: False
Position: Named
Expand Down
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: 1.18.12
Help Version: 1.19.0
Locale: en-US
---

Expand Down
56 changes: 51 additions & 5 deletions PowerShell/JumpCloud Module/Docs/New-JCUser.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ New-JCUser -firstname <String> -lastname <String> -username <String> -email <Str
[-work_region <String>] [-work_postalCode <String>] [-work_country <String>] [-home_streetAddress <String>]
[-home_poBox <String>] [-home_locality <String>] [-home_region <String>] [-home_postalCode <String>]
[-home_country <String>] [-mobile_number <String>] [-home_number <String>] [-work_number <String>]
[-work_mobile_number <String>] [-work_fax_number <String>] [-suspended <Boolean>] [-enrollmentDays <Int32>]
-Attribute1_name <String> -Attribute1_value <String> -Attribute2_name <String> -Attribute2_value <String>
[<CommonParameters>]
[-work_mobile_number <String>] [-work_fax_number <String>] [-suspended <Boolean>] [-manager <String>]
[-managedAppleId <String>] [-alternateEmail <String>] [-enrollmentDays <Int32>] -Attribute1_name <String>
-Attribute1_value <String> -Attribute2_name <String> -Attribute2_value <String> [<CommonParameters>]
```

### Attributes
Expand All @@ -42,8 +42,9 @@ New-JCUser -firstname <String> -lastname <String> -username <String> -email <Str
[-home_streetAddress <String>] [-home_poBox <String>] [-home_locality <String>] [-home_region <String>]
[-home_postalCode <String>] [-home_country <String>] [-mobile_number <String>] [-home_number <String>]
[-work_number <String>] [-work_mobile_number <String>] [-work_fax_number <String>] [-suspended <Boolean>]
[-enrollmentDays <Int32>] -Attribute1_name <String> -Attribute1_value <String> -Attribute2_name <String>
-Attribute2_value <String> [<CommonParameters>]
[-manager <String>] [-managedAppleId <String>] [-alternateEmail <String>] [-enrollmentDays <Int32>]
-Attribute1_name <String> -Attribute1_value <String> -Attribute2_name <String> -Attribute2_value <String>
[<CommonParameters>]
```

## DESCRIPTION
Expand Down Expand Up @@ -91,6 +92,21 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -alternateEmail
The alternateEmail for the user
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -Attribute1_name
Enter an attribute name
Expand Down Expand Up @@ -518,6 +534,36 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -managedAppleId
The managedAppleId for the user
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -manager
The manager for the user must be a JumpCloud user
```yaml
Type: System.String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -middlename
Specifies the user's home location.
The LDAP displayName of this property is initials.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ Specifies the VLAN id which is applied to all attribute names.
Type: System.String
Parameter Sets: (All)
Aliases:
Accepted values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31
Accepted values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31

Required: False
Position: Named
Expand Down
Loading

0 comments on commit 8644a65

Please sign in to comment.