Skip to content

Commit

Permalink
Merge pull request #389 from TheJumpCloud/SA-2642-Get-JCCommand-Searc…
Browse files Browse the repository at this point in the history
…h-Params

Sa 2642 get jc command search params
  • Loading branch information
kmaranionjc authored Jun 23, 2022
2 parents 4f35055 + 6d2aa23 commit 692e5f3
Show file tree
Hide file tree
Showing 9 changed files with 557 additions and 35 deletions.
4 changes: 2 additions & 2 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,7 +45,7 @@ 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
Expand Down
136 changes: 133 additions & 3 deletions PowerShell/JumpCloud Module/Docs/Get-JCCommand.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ Returns all JumpCloud Commands within a JumpCloud tenant or a single JumpCloud C

## SYNTAX

### ReturnAll (Default)
### SearchFilter (Default)
```
Get-JCCommand [<CommonParameters>]
Get-JCCommand [-command <String>] [-name <String>] [-commandType <String>] [-launchType <String>]
[-trigger <String>] [-scheduleRepeatType <String>] [-returnProperties <String[]>] [<CommonParameters>]
```

### ByID
Expand Down Expand Up @@ -52,13 +53,31 @@ Note that when running this command the time for the output to display will be d

### Example 4
```powershell
PS C:\> Get-JCCommand | Where-Object launchType -EQ 'trigger' | Get-JCCommand -ByID
PS C:\> Get-JCCommand -name '*BitLocker*' | Get-JCCommand -ByID
```

Returns all information describing all JumpCloud commands with a name of '*trigger*' by passing the -CommandID Parameter to the -ByID Parameter using the pipeline and Parameter Binding. Note, search parameters on Get-JCCommand support wildcard characters. In this example commands with the name BitLocker somewhere in the name would be returned.

Note that when running this command the time for the output to display will be directly proportionate to how many JumpCloud commands you have with a launchType of 'trigger'. The command 'Get-JCCommand -ByID' runs once for every JumpCloud command within your tenant with a launchType of 'trigger'.

### Example 5
```powershell
PS C:\> Get-JCCommand -launchType 'trigger' | Get-JCCommand -ByID
```

Returns all information describing all JumpCloud commands with a launchType of 'trigger' by passing the -CommandID Parameter to the -ByID Parameter using the pipeline and Parameter Binding.

Note that when running this command the time for the output to display will be directly proportionate to how many JumpCloud commands you have with a launchType of 'trigger'. The command 'Get-JCCommand -ByID' runs once for every JumpCloud command within your tenant with a launchType of 'trigger'.

### Example 6
```powershell
PS C:\> Get-JCCommand -command '*fdesetup*' | Get-JCCommand -ByID
```

Returns all information describing all JumpCloud commands with a command string and the search term "fdesetup", by passing the -CommandID Parameter to the -ByID Parameter using the pipeline and Parameter Binding. Note, search parameters on Get-JCCommand support wildcard characters. In this example commands with the string "fdesetup" somewhere in the command body would be returned.

Note that when running this command the time for the output to display will be directly proportionate to how many JumpCloud commands you have with a launchType of 'trigger'. The command 'Get-JCCommand -ByID' runs once for every JumpCloud command within your tenant with a launchType of 'trigger'.

## PARAMETERS

### -ByID
Expand All @@ -77,6 +96,21 @@ Accept pipeline input: False
Accept wildcard characters: False
```
### -command
The command to execute on the server.
```yaml
Type: System.String
Parameter Sets: SearchFilter
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -CommandID
The _id of the JumpCloud command you wish to query.
Expand All @@ -102,11 +136,107 @@ Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -commandType
Command Type
```yaml
Type: System.String
Parameter Sets: SearchFilter
Aliases:
Accepted values: windows, mac, linux

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -launchType
Launch Type
```yaml
Type: System.String
Parameter Sets: SearchFilter
Aliases:
Accepted values: repeated, one-time, manual, trigger

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -name
Name of the command
```yaml
Type: System.String
Parameter Sets: SearchFilter
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -returnProperties
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'
```yaml
Type: System.String[]
Parameter Sets: SearchFilter
Aliases:
Accepted values: command, name, launchType, commandType, trigger, scheduleRepeatType

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -scheduleRepeatType
When the command will repeat
```yaml
Type: System.String
Parameter Sets: SearchFilter
Aliases:
Accepted values: minute, hour, day, week, month

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### -trigger
The name of the command trigger
```yaml
Type: System.String
Parameter Sets: SearchFilter
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False
```
### CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
### System.String
### System.String[]
## OUTPUTS
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.22.1
Help Version: 1.23.0
Locale: en-US
---

Expand Down
4 changes: 2 additions & 2 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/19/2022
# Generated on: 6/22/2022
#

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

# Version number of this module.
ModuleVersion = '1.22.1'
ModuleVersion = '1.23.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
Loading

0 comments on commit 692e5f3

Please sign in to comment.