From 5d65a16cbc482adda188cfa474b499f9192bb306 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 18 Jun 2024 09:54:52 -0600 Subject: [PATCH 1/6] readable sizes --- .../Public/Systems/Get-JCSystemInsights.ps1 | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 0cd652ba9..0f3eee107 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -107,8 +107,33 @@ Function Get-JCSystemInsights { } Else { Invoke-Expression -Command:($CommandTemplate -f $Table) } + + switch ($Table) { + SystemInfo { + $newResults = @() + $newResults += $Results | ForEach-Object { + $_ | Select-Object -Property *, @{ Name = 'PhysicalMemoryGB'; Expression = { [math]::round($_.PhysicalMemory / 1GB, 3) } } + } + } + mounts { + $newResults = @() + $newResults += $Results | ForEach-Object { + $_ | Select-Object -Property *, @{ Name = 'BlocksAvailableGB'; Expression = { $BlocksAvailableSize = ([long]$_.BlocksAvailable * [long]$_.BlocksSize); [math]::round($BlocksAvailableSize / 1GB, 3) } }, @{ Name = 'BlocksFreeGB'; Expression = { $BlocksFreeSize = [long]$_.BlocksFree * [long]$_.BlocksSize; [math]::round($BlocksFreeSize / 1GB, 3) } } + } + } + logicalDrive { + $newResults = @() + $newResults += $Results | ForEach-Object { + $_ | Select-Object -Property *, @{ Name = 'SizeGB'; Expression = { [math]::round($_.Size / 1GB, 3) } }, @{ Name = 'FreeSpaceGB'; Expression = { [math]::round($_.FreeSpace / 1GB, 3) } } + } + } + } } End { - Return $Results + if ($newResults) { + Return $newResults + } else { + Return $Results + } } } \ No newline at end of file From 9ae01e9426be39dcf9177840829d6c1a87e6a785 Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 18 Jun 2024 10:12:54 -0600 Subject: [PATCH 2/6] build-module --- PowerShell/JumpCloud Module/Docs/JumpCloud.md | 2 +- PowerShell/JumpCloud Module/JumpCloud.psd1 | 30 +++++++++---------- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 22 +++++++++++--- PowerShell/ModuleChangelog.md | 17 +++++++++++ 4 files changed, 51 insertions(+), 20 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/JumpCloud.md b/PowerShell/JumpCloud Module/Docs/JumpCloud.md index 8a034b413..bfee0a621 100644 --- a/PowerShell/JumpCloud Module/Docs/JumpCloud.md +++ b/PowerShell/JumpCloud Module/Docs/JumpCloud.md @@ -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: 2.11.0 +Help Version: 2.12.0 Locale: en-US --- diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index cbd4f807d..588ba1f66 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 6/13/2024 +# Generated on: 6/18/2024 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. - ModuleVersion = '2.11.0' + ModuleVersion = '2.12.0' # Supported PSEditions # CompatiblePSEditions = @() @@ -80,19 +80,19 @@ 'Get-JCCommandTarget', 'Get-JCEvent', 'Get-JCEventCount', 'Get-JCGroup', 'Get-JCOrganization', 'Get-JCPolicy', 'Get-JCPolicyResult', 'Get-JCPolicyTargetGroup', 'Get-JCPolicyTargetSystem', - 'Get-JCRadiusReplyAttribute', 'Get-JCRadiusServer', 'Get-JCScheduledUserstate', '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', + 'Get-JCRadiusReplyAttribute', 'Get-JCRadiusServer', + 'Get-JCScheduledUserstate', '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', diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 9bfeff6ce..3b2c4796d 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -7067,11 +7067,11 @@ PS C:\> $BackupJcOrganizationResults.User Get JCScheduledUserstate - {{ Fill in the Synopsis }} + Returns scheduled userstate changes by state or returns a user's scheduled userstate changes - {{ Fill in the Description }} + Get-JCScheduledUserstate function allows for admins to view upcoming scheduled user suspensions or activations. You can also look up an individual user's upcoming state changes by their userID @@ -7163,9 +7163,23 @@ PS C:\> $BackupJcOrganizationResults.User -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} + Get-JCScheduledUserstate -State "SUSPENDED" - {{ Add example description here }} + Returns all scheduled SUSPENDED userstate changes + + + + -------------------------- Example 2 -------------------------- + Get-JCScheduledUserstate -State "ACTIVATED" + + Returns all scheduled ACTIVATED userstate changes + + + + -------------------------- Example 2 -------------------------- + Get-JCScheduledUserstate -UserID "USERID" + + Returns all scheduled userstate changes for a given userID diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 6326c978b..17620a86e 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,20 @@ +## 2.12.0 + +Release Date: June 18, 2024 + +#### RELEASE NOTES + +``` +Added new calculated fields for Get-JCSystemInsights Tables LogicalDrives, Mounts, and SystemInfo to include human readable sizes in GB for the following fields: PhysicalMemory, blocksFree, blocksAvailable, freeSpace, and size +``` + +#### IMPROVEMENTS: + +* Added calculated fields for the `Get-JCSystemInsights` following tables: + * LogicalDrives - freeSpaceGB, sizeGB + * Mounts - blocksFreeGB, blocksAvailableGB + * systemInfo - physicalMemoryGB + ## 2.11.0 Release Date: June 13, 2024 From 6d20007b01eae8a278eac920dcaea8fedaccb9db Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 18 Jun 2024 11:43:02 -0600 Subject: [PATCH 3/6] mount table base10 calculations --- .../JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 0f3eee107..6615effc0 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -115,10 +115,10 @@ Function Get-JCSystemInsights { $_ | Select-Object -Property *, @{ Name = 'PhysicalMemoryGB'; Expression = { [math]::round($_.PhysicalMemory / 1GB, 3) } } } } - mounts { + mount { $newResults = @() $newResults += $Results | ForEach-Object { - $_ | Select-Object -Property *, @{ Name = 'BlocksAvailableGB'; Expression = { $BlocksAvailableSize = ([long]$_.BlocksAvailable * [long]$_.BlocksSize); [math]::round($BlocksAvailableSize / 1GB, 3) } }, @{ Name = 'BlocksFreeGB'; Expression = { $BlocksFreeSize = [long]$_.BlocksFree * [long]$_.BlocksSize; [math]::round($BlocksFreeSize / 1GB, 3) } } + $_ | Select-Object -Property *, @{ Name = 'BlocksAvailableGB'; Expression = { $BlocksAvailableBytes = ([int64]$_.BlocksAvailable * [int64]$_.BlocksSize); [math]::round($BlocksAvailableBytes / ([Math]::Pow(1000, 3)), 3) } }, @{ Name = 'BlocksGB'; Expression = { $BlocksBytes = [int64]$_.Blocks * [int64]$_.BlocksSize; [math]::round($BlocksBytes / ([Math]::Pow(1000, 3)), 3) } } } } logicalDrive { From fa13a42665b5e689e88e2b2b1a91b76b1aec0a7a Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 18 Jun 2024 11:46:09 -0600 Subject: [PATCH 4/6] Update ModuleChangelog.md --- PowerShell/ModuleChangelog.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 17620a86e..a1e1aa53d 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -5,14 +5,14 @@ Release Date: June 18, 2024 #### RELEASE NOTES ``` -Added new calculated fields for Get-JCSystemInsights Tables LogicalDrives, Mounts, and SystemInfo to include human readable sizes in GB for the following fields: PhysicalMemory, blocksFree, blocksAvailable, freeSpace, and size +Added new calculated fields for Get-JCSystemInsights Tables LogicalDrives, Mounts, and SystemInfo to include human readable sizes in GB for the following fields: PhysicalMemory, blocks, blocksAvailable, freeSpace, and size ``` #### IMPROVEMENTS: * Added calculated fields for the `Get-JCSystemInsights` following tables: * LogicalDrives - freeSpaceGB, sizeGB - * Mounts - blocksFreeGB, blocksAvailableGB + * Mounts - blocksGB, blocksAvailableGB * systemInfo - physicalMemoryGB ## 2.11.0 From 37ac7873abed85e1f7ae32794299afb7083b9adf Mon Sep 17 00:00:00 2001 From: Geoffrey Wein Date: Tue, 18 Jun 2024 12:34:05 -0600 Subject: [PATCH 5/6] jcapisdksync --- .../Public/DirectoryInsights/Get-JCEvent.ps1 | 64 +++++++++---------- .../DirectoryInsights/Get-JCEventCount.ps1 | 62 +++++++++--------- 2 files changed, 59 insertions(+), 67 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 index c0f3d47a3..d9b1ff0ce 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 @@ -69,101 +69,97 @@ BODY : EventQuery is the users' command to search our auth logs .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md #> -Function Get-JCEvent -{ - [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])] - [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] - Param( - [Parameter(ParameterSetName='GetExpanded', Mandatory)] +Function Get-JCEvent { + [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])] + [CmdletBinding(DefaultParameterSetName = 'GetExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')] + Param( + [Parameter(ParameterSetName = 'GetExpanded', Mandatory)] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # service name to query. ${Service}, - [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Parameter(ParameterSetName = 'GetExpanded', Mandatory)] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.DateTime] # query start time, UTC in RFC3339 format ${StartTime}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.DateTime] # optional query end time, UTC in RFC3339 format ${EndTime}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # optional list of fields to return from query ${Fields}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.Int64] # Max number of rows to return ${Limit}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String] # optional string for specifying a full text query ${Q}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # Specific query to search after, see x-* response headers for next values ${SearchAfter}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermAnd}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermNot}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermOr}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String] # ASC or DESC order for timestamp ${Sort}, - [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName = 'Get', Mandatory, ValueFromPipeline)] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [JumpCloud.SDK.DirectoryInsights.Models.IEventQuery] # EventQuery is the users' command to search our auth logs # To construct, see NOTES section for BODY properties and create a hash table. ${Body} - ) - Begin - { - Connect-JCOnline -force | Out-Null - $Results = @() - } - Process - { - $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEvent @PSBoundParameters - } - End - { - Return $Results - } + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEvent @PSBoundParameters + } + End { + Return $Results + } } diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 index f77690c23..fff683885 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 @@ -53,95 +53,91 @@ BODY : EventQuery is the users' command to search our auth logs .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md #> -Function Get-JCEventCount -{ - [OutputType([System.Int64])] - [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] - Param( - [Parameter(ParameterSetName='GetExpanded', Mandatory)] +Function Get-JCEventCount { + [OutputType([System.Int64])] + [CmdletBinding(DefaultParameterSetName = 'GetExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')] + Param( + [Parameter(ParameterSetName = 'GetExpanded', Mandatory)] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # service name to query. ${Service}, - [Parameter(ParameterSetName='GetExpanded', Mandatory)] + [Parameter(ParameterSetName = 'GetExpanded', Mandatory)] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.DateTime] # query start time, UTC in RFC3339 format ${StartTime}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.DateTime] # optional query end time, UTC in RFC3339 format ${EndTime}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # optional list of fields to return from query ${Fields}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String] # optional string for specifying a full text query ${Q}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # Specific query to search after, see x-* response headers for next values ${SearchAfter}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermAnd}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermNot}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermOr}, - [Parameter(ParameterSetName='GetExpanded')] + [Parameter(ParameterSetName = 'GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String] # ASC or DESC order for timestamp ${Sort}, - [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName = 'Get', Mandatory, ValueFromPipeline)] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [JumpCloud.SDK.DirectoryInsights.Models.IEventQuery] # EventQuery is the users' command to search our auth logs # To construct, see NOTES section for BODY properties and create a hash table. ${Body} - ) - Begin - { - Connect-JCOnline -force | Out-Null - $Results = @() - } - Process - { - $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEventCount @PSBoundParameters - } - End - { - Return $Results - } + ) + Begin { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process { + $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEventCount @PSBoundParameters + } + End { + Return $Results + } } From ff3b75702f30bdbf7763f8189b02d026a88a58df Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 18 Jun 2024 13:04:42 -0600 Subject: [PATCH 6/6] JCEvent --- .../Public/DirectoryInsights/Get-JCEvent.ps1 | 64 ++++++++++--------- .../DirectoryInsights/Get-JCEventCount.ps1 | 62 +++++++++--------- 2 files changed, 67 insertions(+), 59 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 index d9b1ff0ce..c0f3d47a3 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 @@ -69,97 +69,101 @@ BODY : EventQuery is the users' command to search our auth logs .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md #> -Function Get-JCEvent { - [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])] - [CmdletBinding(DefaultParameterSetName = 'GetExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')] - Param( - [Parameter(ParameterSetName = 'GetExpanded', Mandatory)] +Function Get-JCEvent +{ + [OutputType([JumpCloud.SDK.DirectoryInsights.Models.IPost200ApplicationJsonItemsItem])] + [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + Param( + [Parameter(ParameterSetName='GetExpanded', Mandatory)] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # service name to query. ${Service}, - [Parameter(ParameterSetName = 'GetExpanded', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.DateTime] # query start time, UTC in RFC3339 format ${StartTime}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.DateTime] # optional query end time, UTC in RFC3339 format ${EndTime}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # optional list of fields to return from query ${Fields}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.Int64] # Max number of rows to return ${Limit}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String] # optional string for specifying a full text query ${Q}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # Specific query to search after, see x-* response headers for next values ${SearchAfter}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermAnd}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermNot}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermOr}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String] # ASC or DESC order for timestamp ${Sort}, - [Parameter(ParameterSetName = 'Get', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [JumpCloud.SDK.DirectoryInsights.Models.IEventQuery] # EventQuery is the users' command to search our auth logs # To construct, see NOTES section for BODY properties and create a hash table. ${Body} - ) - Begin { - Connect-JCOnline -force | Out-Null - $Results = @() - } - Process { - $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEvent @PSBoundParameters - } - End { - Return $Results - } + ) + Begin + { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process + { + $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEvent @PSBoundParameters + } + End + { + Return $Results + } } diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 index fff683885..f77690c23 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 @@ -53,91 +53,95 @@ BODY : EventQuery is the users' command to search our auth logs .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md #> -Function Get-JCEventCount { - [OutputType([System.Int64])] - [CmdletBinding(DefaultParameterSetName = 'GetExpanded', PositionalBinding = $false, SupportsShouldProcess, ConfirmImpact = 'Medium')] - Param( - [Parameter(ParameterSetName = 'GetExpanded', Mandatory)] +Function Get-JCEventCount +{ + [OutputType([System.Int64])] + [CmdletBinding(DefaultParameterSetName='GetExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] + Param( + [Parameter(ParameterSetName='GetExpanded', Mandatory)] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # service name to query. ${Service}, - [Parameter(ParameterSetName = 'GetExpanded', Mandatory)] + [Parameter(ParameterSetName='GetExpanded', Mandatory)] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.DateTime] # query start time, UTC in RFC3339 format ${StartTime}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.DateTime] # optional query end time, UTC in RFC3339 format ${EndTime}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # optional list of fields to return from query ${Fields}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String] # optional string for specifying a full text query ${Q}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [AllowEmptyCollection()] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String[]] # Specific query to search after, see x-* response headers for next values ${SearchAfter}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermAnd}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermNot}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes = ([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] # TermConjunction represents a conjunction (and/or)NOTE: the validator limits what the operator can be, not the objectfor future-proof-nessand a list of sub-values ${SearchTermOr}, - [Parameter(ParameterSetName = 'GetExpanded')] + [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [System.String] # ASC or DESC order for timestamp ${Sort}, - [Parameter(ParameterSetName = 'Get', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='Get', Mandatory, ValueFromPipeline)] [JumpCloud.SDK.DirectoryInsights.Category('Body')] [JumpCloud.SDK.DirectoryInsights.Models.IEventQuery] # EventQuery is the users' command to search our auth logs # To construct, see NOTES section for BODY properties and create a hash table. ${Body} - ) - Begin { - Connect-JCOnline -force | Out-Null - $Results = @() - } - Process { - $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEventCount @PSBoundParameters - } - End { - Return $Results - } + ) + Begin + { + Connect-JCOnline -force | Out-Null + $Results = @() + } + Process + { + $Results = JumpCloud.SDK.DirectoryInsights\Get-JcSdkEventCount @PSBoundParameters + } + End + { + Return $Results + } }