Skip to content

Commit

Permalink
Merge pull request #585 from TheJumpCloud/CUT-4021_SystemInsightsRead…
Browse files Browse the repository at this point in the history
…ableFormat

CUT-4021: Add SystemInsights Readable Format for bytes
  • Loading branch information
gweinjc authored Jun 18, 2024
2 parents 5c4117f + ff3b757 commit 374cb40
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 21 deletions.
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: 2.11.0
Help Version: 2.12.0
Locale: en-US
---

Expand Down
30 changes: 15 additions & 15 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: 6/13/2024
# Generated on: 6/18/2024
#

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

# Version number of this module.
ModuleVersion = '2.11.0'
ModuleVersion = '2.12.0'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) } }
}
}
mount {
$newResults = @()
$newResults += $Results | ForEach-Object {
$_ | 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 {
$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
}
}
}
22 changes: 18 additions & 4 deletions PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7067,11 +7067,11 @@ PS C:\&gt; $BackupJcOrganizationResults.User</dev:code>
<command:verb>Get</command:verb>
<command:noun>JCScheduledUserstate</command:noun>
<maml:description>
<maml:para>{{ Fill in the Synopsis }}</maml:para>
<maml:para>Returns scheduled userstate changes by state or returns a user's scheduled userstate changes</maml:para>
</maml:description>
</command:details>
<maml:description>
<maml:para>{{ Fill in the Description }}</maml:para>
<maml:para>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</maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
Expand Down Expand Up @@ -7163,9 +7163,23 @@ PS C:\&gt; $BackupJcOrganizationResults.User</dev:code>
<command:examples>
<command:example>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; {{ Add example code here }}</dev:code>
<dev:code>Get-JCScheduledUserstate -State "SUSPENDED"</dev:code>
<dev:remarks>
<maml:para>{{ Add example description here }}</maml:para>
<maml:para>Returns all scheduled SUSPENDED userstate changes</maml:para>
</dev:remarks>
</command:example>
<command:example>
<maml:title>-------------------------- Example 2 --------------------------</maml:title>
<dev:code>Get-JCScheduledUserstate -State "ACTIVATED"</dev:code>
<dev:remarks>
<maml:para>Returns all scheduled ACTIVATED userstate changes</maml:para>
</dev:remarks>
</command:example>
<command:example>
<maml:title>-------------------------- Example 2 --------------------------</maml:title>
<dev:code>Get-JCScheduledUserstate -UserID "USERID"</dev:code>
<dev:remarks>
<maml:para>Returns all scheduled userstate changes for a given userID</maml:para>
</dev:remarks>
</command:example>
</command:examples>
Expand Down
17 changes: 17 additions & 0 deletions PowerShell/ModuleChangelog.md
Original file line number Diff line number Diff line change
@@ -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, blocks, blocksAvailable, freeSpace, and size
```

#### IMPROVEMENTS:

* Added calculated fields for the `Get-JCSystemInsights` following tables:
* LogicalDrives - freeSpaceGB, sizeGB
* Mounts - blocksGB, blocksAvailableGB
* systemInfo - physicalMemoryGB

## 2.11.0

Release Date: June 13, 2024
Expand Down

0 comments on commit 374cb40

Please sign in to comment.