From 5a918d02b1ce5e9ccfb9ccfc9c1aaeed67d76d39 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Fri, 31 Jul 2020 15:38:42 -0600 Subject: [PATCH 01/51] multi function import w/ jcapi2support & wrapper --- .../Deploy/SdkSync/jcapiToSupportSync.ps1 | 131 ++++++++++-------- .../Systems/Get-JCSystemInsightsWrapped.ps1 | 81 +++++++++++ 2 files changed, 151 insertions(+), 61 deletions(-) create mode 100644 PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 diff --git a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 index 62ef6e747..de9c33f94 100644 --- a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 +++ b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 @@ -12,6 +12,13 @@ $ApprovedFunctions = [Ordered]@{ Name = 'Get-JcSdkEventCount' } ) + # 'JumpCloud.SDK.V2' = @( + # # Commented Out To Prevent Build + # [PSCustomObject]@{ + # Destination = 'Public/Systems' + # Name = 'Get-JcSdkSystemInsight*' + # } + # ) } $SdkPrefix = 'JcSdk' $JumpCloudModulePrefix = 'JC' @@ -35,70 +42,72 @@ If (-not [System.String]::IsNullOrEmpty($Modules)) $FunctionDestination = $Function.Destination $OutputPath = "$JumpCloudModulePath/$FunctionDestination" $Command = Get-Command -Name:($FunctionName) - $CommandName = $Command.Name - $NewCommandName = $CommandName.Replace($SdkPrefix, $JumpCloudModulePrefix) - Write-Host ("[STATUS] Building: $NewCommandName") -BackgroundColor:('Black') -ForegroundColor:('Magenta') - # Get content from sdk function - $CommandFilePath = $Command.ScriptBlock.File - $CommandFilePathContent = Get-Content -Path:($CommandFilePath) -Raw - $FunctionContent = If ($CommandFilePath -like '*ProxyCmdletDefinitions.ps1') - { - <# 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( { $_ -like ('*' + "function $CommandName {" + '*') }) - } - Else - { - <# When the autorest generated module has been imported from a local psd1 module the function will - remain in their individual files. #> - $CommandFilePathContent - } - $PSScriptInfo = ($FunctionContent | Select-String -Pattern:('(?s)(<#)(.*?)(#>)')).Matches.Value - $Params = $FunctionContent | Select-String -Pattern:('(?s)( \[Parameter)(.*?)(\})') -AllMatches - $ParameterContent = ($Params.Matches.Value | Where-Object { $_ -notlike '*DontShow*' -and $_ -notlike '*Limit*' -and $_ -notlike '*Skip*' }) - $OutputType = ($FunctionContent | Select-String -Pattern:('(\[OutputType)(.*?)(\]\r)')).Matches.Value - $CmdletBinding = ($FunctionContent | Select-String -Pattern:('(\[CmdletBinding)(.*?)(\]\r)')).Matches.Value - If (-not [System.String]::IsNullOrEmpty($PSScriptInfo)) - { - $PSScriptInfo = $PSScriptInfo.Replace($SdkPrefix, $JumpCloudModulePrefix) - $PSScriptInfo = $PSScriptInfo.Replace("$NewCommandName.md", "$FunctionName.md") - } - # Build CmdletBinding - If (-not [System.String]::IsNullOrEmpty($OutputType)) { $CmdletBinding = "$($OutputType)`n$($IndentChar)$($CmdletBinding)" } - # Build $BeginContent, $ProcessContent, and $EndContent - $BeginContent = @() - $ProcessContent = @() - $EndContent = @() - # Build "Begin" block - $BeginContent += "$($IndentChar)$($IndentChar)Connect-JCOnline -force | Out-Null" - $BeginContent += "$($IndentChar)$($IndentChar)`$Results = @()" - # Build "Process" block - $ProcessContent += "$($IndentChar)$($IndentChar)`$Results = $($ModuleName)\$($CommandName) @PSBoundParameters" - # Build "End" block - $EndContent += "$($IndentChar)$($IndentChar)Return `$Results" - If (-not [System.String]::IsNullOrEmpty($BeginContent) -and -not [System.String]::IsNullOrEmpty($ProcessContent) -and -not [System.String]::IsNullOrEmpty($EndContent)) - { - # Build "Function" - $NewScript = $FunctionTemplate -f $PSScriptInfo, $NewCommandName, $CmdletBinding, ($ParameterContent -join ",`n`n"), ($BeginContent -join "`n"), ($ProcessContent -join "`n"), ($EndContent -join "`n") - # Fix line endings - $NewScript = $NewScript.Replace("`r`n", "`n").Trim() - # Export the function - $OutputFilePath = "$OutputPath/$NewCommandName.ps1" - New-FolderRecursive -Path:($OutputFilePath) -Force - $NewScript | Out-File -FilePath:($OutputFilePath) -Force - # Validate script syntax - $ScriptAnalyzerResult = Invoke-ScriptAnalyzer -Path:($OutputFilePath) -Recurse -ExcludeRule PSShouldProcess, PSAvoidTrailingWhitespace, PSAvoidUsingWMICmdlet, PSAvoidUsingPlainTextForPassword, PSAvoidUsingUsernameAndPasswordParams, PSAvoidUsingInvokeExpression, PSUseDeclaredVarsMoreThanAssignments, PSUseSingularNouns, PSAvoidGlobalVars, PSUseShouldProcessForStateChangingFunctions, PSAvoidUsingWriteHost, PSAvoidUsingPositionalParameters - If ($ScriptAnalyzerResult) + foreach ($individualCommand in $Command){ + $CommandName = $individualCommand.Name + $NewCommandName = $CommandName.Replace($SdkPrefix, $JumpCloudModulePrefix) + Write-Host ("[STATUS] Building: $NewCommandName") -BackgroundColor:('Black') -ForegroundColor:('Magenta') + # Get content from sdk function + $CommandFilePath = $individualCommand.ScriptBlock.File + $CommandFilePathContent = Get-Content -Path:($CommandFilePath) -Raw + $FunctionContent = If ($CommandFilePath -like '*ProxyCmdletDefinitions.ps1') + { + <# 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( { $_ -like ('*' + "function $CommandName {" + '*') }) + } + Else + { + <# When the autorest generated module has been imported from a local psd1 module the function will + remain in their individual files. #> + $CommandFilePathContent + } + $PSScriptInfo = ($FunctionContent | Select-String -Pattern:('(?s)(<#)(.*?)(#>)')).Matches.Value + $Params = $FunctionContent | Select-String -Pattern:('(?s)( \[Parameter)(.*?)(\})') -AllMatches + $ParameterContent = ($Params.Matches.Value | Where-Object { $_ -notlike '*DontShow*' -and $_ -notlike '*Limit*' -and $_ -notlike '*Skip*' }) + $OutputType = ($FunctionContent | Select-String -Pattern:('(\[OutputType)(.*?)(\]\r)')).Matches.Value + $CmdletBinding = ($FunctionContent | Select-String -Pattern:('(\[CmdletBinding)(.*?)(\]\r)')).Matches.Value + If (-not [System.String]::IsNullOrEmpty($PSScriptInfo)) + { + $PSScriptInfo = $PSScriptInfo.Replace($SdkPrefix, $JumpCloudModulePrefix) + $PSScriptInfo = $PSScriptInfo.Replace("$NewCommandName.md", "$FunctionName.md") + } + # Build CmdletBinding + If (-not [System.String]::IsNullOrEmpty($OutputType)) { $CmdletBinding = "$($OutputType)`n$($IndentChar)$($CmdletBinding)" } + # Build $BeginContent, $ProcessContent, and $EndContent + $BeginContent = @() + $ProcessContent = @() + $EndContent = @() + # Build "Begin" block + $BeginContent += "$($IndentChar)$($IndentChar)Connect-JCOnline -force | Out-Null" + $BeginContent += "$($IndentChar)$($IndentChar)`$Results = @()" + # Build "Process" block + $ProcessContent += "$($IndentChar)$($IndentChar)`$Results = $($ModuleName)\$($CommandName) @PSBoundParameters" + # Build "End" block + $EndContent += "$($IndentChar)$($IndentChar)Return `$Results" + If (-not [System.String]::IsNullOrEmpty($BeginContent) -and -not [System.String]::IsNullOrEmpty($ProcessContent) -and -not [System.String]::IsNullOrEmpty($EndContent)) { - $ScriptAnalyzerResults += $ScriptAnalyzerResult + # Build "Function" + $NewScript = $FunctionTemplate -f $PSScriptInfo, $NewCommandName, $CmdletBinding, ($ParameterContent -join ",`n`n"), ($BeginContent -join "`n"), ($ProcessContent -join "`n"), ($EndContent -join "`n") + # Fix line endings + $NewScript = $NewScript.Replace("`r`n", "`n").Trim() + # Export the function + $OutputFilePath = "$OutputPath/$NewCommandName.ps1" + New-FolderRecursive -Path:($OutputFilePath) -Force + $NewScript | Out-File -FilePath:($OutputFilePath) -Force + # Validate script syntax + $ScriptAnalyzerResult = Invoke-ScriptAnalyzer -Path:($OutputFilePath) -Recurse -ExcludeRule PSShouldProcess, PSAvoidTrailingWhitespace, PSAvoidUsingWMICmdlet, PSAvoidUsingPlainTextForPassword, PSAvoidUsingUsernameAndPasswordParams, PSAvoidUsingInvokeExpression, PSUseDeclaredVarsMoreThanAssignments, PSUseSingularNouns, PSAvoidGlobalVars, PSUseShouldProcessForStateChangingFunctions, PSAvoidUsingWriteHost, PSAvoidUsingPositionalParameters + If ($ScriptAnalyzerResult) + { + $ScriptAnalyzerResults += $ScriptAnalyzerResult + } } + # Copy tests? + # Copy-Item -Path:($AutoRest_Tests) -Destination:($JCModule_Tests) -Force + # Update .Psd1 file + $Psd1.FunctionsToExport += $NewCommandName + Update-ModuleManifest -Path:($FilePath_psd1) -FunctionsToExport:($Psd1.FunctionsToExport) } - # Copy tests? - # Copy-Item -Path:($AutoRest_Tests) -Destination:($JCModule_Tests) -Force - # Update .Psd1 file - $Psd1.FunctionsToExport += $NewCommandName - Update-ModuleManifest -Path:($FilePath_psd1) -FunctionsToExport:($Psd1.FunctionsToExport) } } } diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 new file mode 100644 index 000000000..718bd24b8 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 @@ -0,0 +1,81 @@ +function Get-JCSystemInsightsWrapped{ + [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] + param( + [string[]] + ${name2}, + [string[]] + ${Filter}, + [string[]] + ${Sort}, + [bool] + ${Paginate}) + DynamicParam{ + $dict = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary + $attr = New-Object System.Management.Automation.ParameterAttribute + $attr.HelpMessage = "Dashboard Components to include" + $attr.ValueFromPipelineByPropertyName = $true + $attrColl = New-Object System.Collections.ObjectModel.Collection[System.Attribute] + $attrColl.Add($attr) + # $attrColl.Add((New-Object System.Management.Automation.ValidateSetAttribute(Get-ChildItem -Path '/Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsight*' | Select-Object -ExpandProperty BaseName))) + # $attrColl.Add((New-Object System.Management.Automation.ValidateSetAttribute(Get-Command -Module JumpCloud.SDK.V2 | Where-Object Name -Match "Get-JcSdkSystemInsight*" | Select-Object -ExpandProperty Name))) + $attrColl.Add((New-Object System.Management.Automation.ValidateSetAttribute(Get-Command -Module JumpCloud.SDK.V2 | Where-Object Name -Match "Get-JcSdkSystemInsight*" | ForEach-Object { $_ -replace "Get-JcSdkSystemInsight*", "" }))) + $param = New-Object System.Management.Automation.RuntimeDefinedParameter('Table', [string], $attrColl) + $dict.Add('Table', $param) + # Write-Host($dict) + return $dict + } + begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + if ($PSBoundParameters["Table"]){ + $Table = $PSBoundParameters["Table"] + } + $InsightsCommandFull = "Get-JcSdkSystemInsight" + "$Table" + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand($InsightsCommandFull, [System.Management.Automation.CommandTypes]::Function) + # Write-Host ($wrappedCmd) + $pass = @() + foreach ($param in $PSBoundParameters){ + if ($param.key -eq $wrappedCmd.Parameters.Keys){ + $pass += $param + } + } + $scriptCmd = { & $wrappedCmd @pass } + $steppablePipeline = $scriptCmd.GetSteppablePipeline() + $steppablePipeline.Begin($PSCmdlet) + } + catch { + throw + } + } + process { + try { + $steppablePipeline.Process($_) + } + catch { + throw + } + } + end { + try { + $steppablePipeline.End() + } + catch { + throw + } + } + <# + .ForwardHelpTargetName $InsightsCommandFull + .ForwardHelpCategory Function + #> +} +# $scriptBlock = { Get-ChildItem -Path 'C:\Program Files' | Select-Object -ExpandProperty Name2 } +# # Get-ChildItem -Path '/Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsight*' | Select-Object -ExpandProperty Name +# $scriptblock = { +# param($commandName, $parameterName, $stringMatch) +# Get-ChildItem -Path '/Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsight*' | Select-Object -ExpandProperty BaseName + +# } + From 4578dad032d0c1a97a59f05c7dbd336da743ef8f Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Fri, 31 Jul 2020 15:46:01 -0600 Subject: [PATCH 02/51] add function to psd1 --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- .../Public/Systems/Get-JCSystemInsightsWrapped.ps1 | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 4ca2fac3a..e80b93fdf 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -80,7 +80,7 @@ FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Get-JCPolicy', 'Get-JCPolicyResult', 'Get-JCPolicyTargetGroup', 'Get-JCPolicyTargetSystem', 'Get-JCRadiusReplyAttribute', 'Get-JCRadiusServer', 'Get-JCSystem', 'Get-JCSystemGroupMember', - 'Get-JCSystemInsights', 'Get-JCSystemUser', 'Get-JCUser', + 'Get-JCSystemInsights', 'Get-JCSystemInsightsWrapped', 'Get-JCSystemUser', 'Get-JCUser', 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', 'New-JCDeploymentTemplate', 'New-JCImportTemplate', diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 index 718bd24b8..b14439ee8 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 @@ -1,8 +1,6 @@ function Get-JCSystemInsightsWrapped{ [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] param( - [string[]] - ${name2}, [string[]] ${Filter}, [string[]] @@ -12,7 +10,7 @@ function Get-JCSystemInsightsWrapped{ DynamicParam{ $dict = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary $attr = New-Object System.Management.Automation.ParameterAttribute - $attr.HelpMessage = "Dashboard Components to include" + $attr.HelpMessage = "System Insights Table" $attr.ValueFromPipelineByPropertyName = $true $attrColl = New-Object System.Collections.ObjectModel.Collection[System.Attribute] $attrColl.Add($attr) From 41dc0a53407c35cfb291dce05c7e62f9ce9450c2 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Tue, 4 Aug 2020 09:47:42 -0600 Subject: [PATCH 03/51] change pass to psboundparams --- .../Systems/Get-JCSystemInsightsWrapped.ps1 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 index b14439ee8..33b92b057 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 @@ -33,15 +33,14 @@ function Get-JCSystemInsightsWrapped{ } $InsightsCommandFull = "Get-JcSdkSystemInsight" + "$Table" $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand($InsightsCommandFull, [System.Management.Automation.CommandTypes]::Function) - # Write-Host ($wrappedCmd) - $pass = @() - foreach ($param in $PSBoundParameters){ - if ($param.key -eq $wrappedCmd.Parameters.Keys){ - $pass += $param + Write-Host ($wrappedCmd) + foreach ($item in $PSBoundParameters){ + if ($item.Keys -notin $wrappedCmd.Parameters.Keys){ + $PSBoundParameters.Remove($item.Keys) | Out-Null } } - $scriptCmd = { & $wrappedCmd @pass } - $steppablePipeline = $scriptCmd.GetSteppablePipeline() + $scriptCmd = { & $wrappedCmd @PSBoundParameters } + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) $steppablePipeline.Begin($PSCmdlet) } catch { @@ -58,7 +57,8 @@ function Get-JCSystemInsightsWrapped{ } end { try { - $steppablePipeline.End() + $results = $steppablePipeline.End() + Write-Host("boogers" + $results) } catch { throw From 14d0eeeb1f113109703a7cbfa0e134f727e09468 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 5 Aug 2020 11:06:58 -0600 Subject: [PATCH 04/51] fix output, remove test string --- .../Public/Systems/Get-JCSystemInsightsWrapped.ps1 | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 index 33b92b057..3b00679ff 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 @@ -57,8 +57,7 @@ function Get-JCSystemInsightsWrapped{ } end { try { - $results = $steppablePipeline.End() - Write-Host("boogers" + $results) + $steppablePipeline.End() } catch { throw From d85a4fe8f1dfa27703b498702f1372730ead38e4 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Wed, 5 Aug 2020 11:08:22 -0600 Subject: [PATCH 05/51] testing tab auto complete --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 46 ++++++++--------- PowerShell/JumpCloud Module/JumpCloud.psm1 | 51 +++++++++++++++++-- .../Systems/Get-JCSystemInsightsElliott.ps1 | 43 ++++++++++++++++ 3 files changed, 112 insertions(+), 28 deletions(-) create mode 100644 PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index e80b93fdf..64984e0e4 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -71,29 +71,29 @@ RequiredModules = @('JumpCloud.SDK.DirectoryInsights', # 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-JCRadiusReplyAttribute', 'Add-JCSystemGroupMember', - 'Add-JCSystemUser', 'Add-JCUserGroupMember', 'Connect-JCOnline', - 'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup', - '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-JCSystemGroupMember', - 'Get-JCSystemInsights', 'Get-JCSystemInsightsWrapped', 'Get-JCSystemUser', 'Get-JCUser', - 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', - 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', - 'New-JCDeploymentTemplate', 'New-JCImportTemplate', - 'New-JCRadiusServer', 'New-JCSystemGroup', 'New-JCUser', - 'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand', - 'Remove-JCCommandResult', 'Remove-JCCommandTarget', - 'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer', - 'Remove-JCSystem', 'Remove-JCSystemGroup', - 'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser', - 'Remove-JCUserGroup', 'Remove-JCUserGroupMember', - 'Send-JCPasswordReset', 'Set-JCCommand', 'Set-JCOrganization', - 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', - 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', +FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', + 'Add-JCRadiusReplyAttribute', 'Add-JCSystemGroupMember', + 'Add-JCSystemUser', 'Add-JCUserGroupMember', 'Connect-JCOnline', + 'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup', + '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-JCSystemGroupMember', + 'Get-JCSystemInsights', 'Get-JCSystemInsightsWrapped','Get-JCSystemInsightsElliott', 'Get-JCSystemUser', 'Get-JCUser', + 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', + 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', + 'New-JCDeploymentTemplate', 'New-JCImportTemplate', + 'New-JCRadiusServer', 'New-JCSystemGroup', 'New-JCUser', + 'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand', + 'Remove-JCCommandResult', 'Remove-JCCommandTarget', + 'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer', + 'Remove-JCSystem', 'Remove-JCSystemGroup', + 'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser', + 'Remove-JCUserGroup', 'Remove-JCUserGroupMember', + 'Send-JCPasswordReset', 'Set-JCCommand', 'Set-JCOrganization', + 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', + 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', 'Update-JCModule', '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. diff --git a/PowerShell/JumpCloud Module/JumpCloud.psm1 b/PowerShell/JumpCloud Module/JumpCloud.psm1 index 5e8ffeb24..60a1f0660 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psm1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psm1 @@ -1,17 +1,57 @@ # Load all functions from public and private folders $Public = @( Get-ChildItem -Path "$PSScriptRoot/Public/*.ps1" -Recurse ) $Private = @( Get-ChildItem -Path "$PSScriptRoot/Private/*.ps1" -Recurse) -Foreach ($Import in @($Public + $Private)) { - Try { +Foreach ($Import in @($Public + $Private)) +{ + Try + { . $Import.FullName } - Catch { + Catch + { Write-Error -Message "Failed to import function $($Import.FullName): $_" } } # Set default values for function parameters $PSDefaultParameterValues['Invoke-RestMethod:ContentType'] = 'application/json; charset=utf-8' $PSDefaultParameterValues['Invoke-WebRequest:ContentType'] = 'application/json; charset=utf-8' +# Populate values for function parameters +$SystemInsightsPrefix = 'Get-JcSdkSystemInsight' +$SystemInsightsTables = @{} +$Commands = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$SystemInsightsPrefix*") +ForEach ($Command In $Commands) +{ + $Help = Get-Help -Name:($Command) + $SystemInsightsTables.Add($Command.Name.Replace($SystemInsightsPrefix, ''), $Help.Description.Text + ' ' + $Help.parameters.parameter.Where( { $_.Name -eq 'filter' }).Description.Text + ' EX: {field}:{operator}:{searchValue}' ) +} +Register-ArgumentCompleter -CommandName Get-JCSystemInsightsElliott -ParameterName Table -ScriptBlock { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + $FilterFilter = $fakeBoundParameter.Filter + $SystemInsightsTables.Keys | Where-Object { $_ -like "${wordToComplete}*" } | Where-Object { + $SystemInsightsTables.$_ -like "${FilterFilter}*" + } | ForEach-Object { + New-Object System.Management.Automation.CompletionResult ( + $_, + $_, + 'ParameterValue', + $_ + ) + } +} +Register-ArgumentCompleter -CommandName Get-JCSystemInsightsElliott -ParameterName Filter -ScriptBlock { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + $TypeFilter = $fakeBoundParameter.Table + $SystemInsightsTables.Keys | Where-Object { $_ -like "${TypeFilter}*" } | ForEach-Object { $SystemInsightsTables.$_ | + Where-Object { $_ -like "${wordToComplete}*" } } | + Sort-Object -Unique | ForEach-Object { + New-Object System.Management.Automation.CompletionResult ( + $_, + $_, + 'ParameterValue', + $_ + ) + } +} # https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager?view=netcore-3.1 # Required [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls, [System.Net.SecurityProtocolType]::Tls11, [System.Net.SecurityProtocolType]::Tls12 @@ -31,11 +71,12 @@ If ($PSVersionTable.PSEdition -eq 'Core') $PSDefaultParameterValues['Invoke-WebRequest:MaximumRetryCount'] = 5 $PSDefaultParameterValues['Invoke-WebRequest:RetryIntervalSec'] = 5 } -Else { +Else +{ #Ignore SSL errors / do not add policy if it exists if (-Not [System.Net.ServicePointManager]::CertificatePolicy) { - Add-Type @" + Add-Type @" using System.Net; using System.Security.Cryptography.X509Certificates; public class TrustAllCertsPolicy : ICertificatePolicy { diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 new file mode 100644 index 000000000..9f5d9fe84 --- /dev/null +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 @@ -0,0 +1,43 @@ +Function Get-JCSystemInsightsElliott +{ + [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] + Param( + [Parameter(Mandatory)] + [JumpCloud.SDK.V2.Category('Query')] + [System.String[]] + # Name of the SystemInsights table to query. See docs.jumpcloud.com for list of avalible table endpoints. + $Table, + + [Parameter()] + [JumpCloud.SDK.V2.Category('Query')] + [System.String[]] + # Supported operators are: eq + ${Filter}, + + [Parameter()] + [JumpCloud.SDK.V2.Category('Query')] + [System.String[]] + # The comma separated fields used to sort the collection. + # Default sort is ascending, prefix with `-` to sort descending. + ${Sort}, + + [Parameter(DontShow)] + [System.Boolean] + # Set to $true to return all results. This will overwrite any skip and limit parameter. + $Paginate = $true + ) + Begin + { + $Results = @() + } + Process + { + $PSBoundParameters.Remove('Table') | Out-Null + $Command = "JumpCloud.SDK.V2\Get-JcSdkSystemInsight$Table @PSBoundParameters" + $Results = Invoke-Expression -Command:($Command) + } + End + { + Return $Results + } +} \ No newline at end of file From c1d2be3e611e7f30aeb9ae522e40130406373e5e Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Wed, 5 Aug 2020 13:15:34 -0600 Subject: [PATCH 06/51] move logic into script --- PowerShell/JumpCloud Module/JumpCloud.psm1 | 37 ------------------- .../Systems/Get-JCSystemInsightsElliott.ps1 | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psm1 b/PowerShell/JumpCloud Module/JumpCloud.psm1 index 60a1f0660..4a936aa1c 100644 --- a/PowerShell/JumpCloud Module/JumpCloud.psm1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psm1 @@ -15,43 +15,6 @@ Foreach ($Import in @($Public + $Private)) # Set default values for function parameters $PSDefaultParameterValues['Invoke-RestMethod:ContentType'] = 'application/json; charset=utf-8' $PSDefaultParameterValues['Invoke-WebRequest:ContentType'] = 'application/json; charset=utf-8' -# Populate values for function parameters -$SystemInsightsPrefix = 'Get-JcSdkSystemInsight' -$SystemInsightsTables = @{} -$Commands = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$SystemInsightsPrefix*") -ForEach ($Command In $Commands) -{ - $Help = Get-Help -Name:($Command) - $SystemInsightsTables.Add($Command.Name.Replace($SystemInsightsPrefix, ''), $Help.Description.Text + ' ' + $Help.parameters.parameter.Where( { $_.Name -eq 'filter' }).Description.Text + ' EX: {field}:{operator}:{searchValue}' ) -} -Register-ArgumentCompleter -CommandName Get-JCSystemInsightsElliott -ParameterName Table -ScriptBlock { - param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) - $FilterFilter = $fakeBoundParameter.Filter - $SystemInsightsTables.Keys | Where-Object { $_ -like "${wordToComplete}*" } | Where-Object { - $SystemInsightsTables.$_ -like "${FilterFilter}*" - } | ForEach-Object { - New-Object System.Management.Automation.CompletionResult ( - $_, - $_, - 'ParameterValue', - $_ - ) - } -} -Register-ArgumentCompleter -CommandName Get-JCSystemInsightsElliott -ParameterName Filter -ScriptBlock { - param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) - $TypeFilter = $fakeBoundParameter.Table - $SystemInsightsTables.Keys | Where-Object { $_ -like "${TypeFilter}*" } | ForEach-Object { $SystemInsightsTables.$_ | - Where-Object { $_ -like "${wordToComplete}*" } } | - Sort-Object -Unique | ForEach-Object { - New-Object System.Management.Automation.CompletionResult ( - $_, - $_, - 'ParameterValue', - $_ - ) - } -} # https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager?view=netcore-3.1 # Required [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls, [System.Net.SecurityProtocolType]::Tls11, [System.Net.SecurityProtocolType]::Tls12 diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 index 9f5d9fe84..fa643082e 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 @@ -1,3 +1,40 @@ +# Populate values for function parameters +$SystemInsightsPrefix = 'Get-JcSdkSystemInsight' +$SystemInsightsTables = @{} +$Commands = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$SystemInsightsPrefix*") +ForEach ($Command In $Commands) +{ + $Help = Get-Help -Name:($Command) + $SystemInsightsTables.Add($Command.Name.Replace($SystemInsightsPrefix, ''), $Help.Description.Text + ' ' + $Help.parameters.parameter.Where( { $_.Name -eq 'filter' }).Description.Text + ' EX: {field}:{operator}:{searchValue}' ) +} +Register-ArgumentCompleter -CommandName Get-JCSystemInsightsElliott -ParameterName Table -ScriptBlock { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + $FilterFilter = $fakeBoundParameter.Filter + $SystemInsightsTables.Keys | Where-Object { $_ -like "${wordToComplete}*" } | Where-Object { + $SystemInsightsTables.$_ -like "${FilterFilter}*" + } | ForEach-Object { + New-Object System.Management.Automation.CompletionResult ( + $_, + $_, + 'ParameterValue', + $_ + ) + } +} +Register-ArgumentCompleter -CommandName Get-JCSystemInsightsElliott -ParameterName Filter -ScriptBlock { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + $TypeFilter = $fakeBoundParameter.Table + $SystemInsightsTables.Keys | Where-Object { $_ -like "${TypeFilter}*" } | ForEach-Object { $SystemInsightsTables.$_ | + Where-Object { $_ -like "${wordToComplete}*" } } | + Sort-Object -Unique | ForEach-Object { + New-Object System.Management.Automation.CompletionResult ( + $_, + $_, + 'ParameterValue', + $_ + ) + } +} Function Get-JCSystemInsightsElliott { [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] From 3e64ccd0105b86fe7cf4a33b9f5f77f78273bc7d Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Wed, 5 Aug 2020 19:21:34 +0000 Subject: [PATCH 07/51] Push to refs/heads/SA-1275_Get-JCSystemInsights_SDK;[skip ci] --- .../Docs/Get-JCSystemInsightsElliott.md | 90 ++++++ .../Docs/Get-JCSystemInsightsWrapped.md | 102 +++++++ PowerShell/JumpCloud Module/JumpCloud.psd1 | 58 ++-- .../Get-JCSystemInsightsElliott.Tests.ps1 | 0 .../Get-JCSystemInsightsWrapped.Tests.ps1 | 0 .../JumpCloud Module/en-Us/JumpCloud-help.xml | 270 ++++++++++++++++++ PowerShell/ModuleBanner.md | 8 +- PowerShell/ModuleChangelog.md | 22 ++ 8 files changed, 517 insertions(+), 33 deletions(-) create mode 100644 PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsElliott.md create mode 100644 PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsWrapped.md create mode 100644 PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsElliott.Tests.ps1 create mode 100644 PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsWrapped.Tests.ps1 diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsElliott.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsElliott.md new file mode 100644 index 000000000..c71ccc148 --- /dev/null +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsElliott.md @@ -0,0 +1,90 @@ +--- +external help file: JumpCloud-help.xml +Module Name: JumpCloud +online version: https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsightsElliott +schema: 2.0.0 +--- + +# Get-JCSystemInsightsElliott + +## SYNOPSIS +{{ Fill in the Synopsis }} + +## SYNTAX + +``` +Get-JCSystemInsightsElliott -Table [-Filter ] [-Sort ] [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -Filter +{{ Fill Filter Description }} + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Sort +{{ Fill Sort Description }} + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Table +{{ Fill Table Description }} + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +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 + +### None + +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsWrapped.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsWrapped.md new file mode 100644 index 000000000..b79e105d6 --- /dev/null +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsWrapped.md @@ -0,0 +1,102 @@ +--- +external help file: JumpCloud-help.xml +Module Name: JumpCloud +online version: https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsightsWrapped +schema: 2.0.0 +--- + +# Get-JCSystemInsightsWrapped + +## SYNOPSIS + +## SYNTAX + +``` +Get-JCSystemInsightsWrapped [-Filter ] [-Sort ] [-Paginate ] [-Table ] + [] +``` + +## DESCRIPTION +{{ Fill in the Description }} + +## EXAMPLES + +### Example 1 +```powershell +PS C:\> {{ Add example code here }} +``` + +{{ Add example description here }} + +## PARAMETERS + +### -Filter +{{ Fill Filter Description }} + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Sort +{{ Fill Sort Description }} + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Paginate +{{ Fill Paginate Description }} + +```yaml +Type: System.Boolean +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: False +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Table +System Insights Table + +```yaml +Type: System.String +Parameter Sets: (All) +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 + +## OUTPUTS + +## NOTES + +## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 64984e0e4..5b373ecd3 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 7/20/2020 +# Generated on: 8/5/2020 # @{ @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.17.5' +ModuleVersion = '1.18.0' # Supported PSEditions # CompatiblePSEditions = @() @@ -71,30 +71,32 @@ RequiredModules = @('JumpCloud.SDK.DirectoryInsights', # 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-JCRadiusReplyAttribute', 'Add-JCSystemGroupMember', - 'Add-JCSystemUser', 'Add-JCUserGroupMember', 'Connect-JCOnline', - 'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup', - '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-JCSystemGroupMember', - 'Get-JCSystemInsights', 'Get-JCSystemInsightsWrapped','Get-JCSystemInsightsElliott', 'Get-JCSystemUser', 'Get-JCUser', - 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', - 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', - 'New-JCDeploymentTemplate', 'New-JCImportTemplate', - 'New-JCRadiusServer', 'New-JCSystemGroup', 'New-JCUser', - 'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand', - 'Remove-JCCommandResult', 'Remove-JCCommandTarget', - 'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer', - 'Remove-JCSystem', 'Remove-JCSystemGroup', - 'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser', - 'Remove-JCUserGroup', 'Remove-JCUserGroupMember', - 'Send-JCPasswordReset', 'Set-JCCommand', 'Set-JCOrganization', - 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', - 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', - 'Update-JCModule', 'Update-JCUsersFromCSV' +FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', + 'Add-JCRadiusReplyAttribute', 'Add-JCSystemGroupMember', + 'Add-JCSystemUser', 'Add-JCUserGroupMember', 'Connect-JCOnline', + 'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup', + '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-JCSystemGroupMember', + 'Get-JCSystemInsights', 'Get-JCSystemInsightsElliott', + 'Get-JCSystemInsightsWrapped', 'Get-JCSystemUser', 'Get-JCUser', + 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', + 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', + 'New-JCDeploymentTemplate', 'New-JCImportTemplate', + 'New-JCRadiusServer', 'New-JCSystemGroup', 'New-JCUser', + 'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand', + 'Remove-JCCommandResult', 'Remove-JCCommandTarget', + 'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer', + 'Remove-JCSystem', 'Remove-JCSystemGroup', + 'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser', + 'Remove-JCUserGroup', 'Remove-JCUserGroupMember', + 'Send-JCPasswordReset', 'Set-JCCommand', 'Set-JCOrganization', + 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', + 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', + 'Update-JCModule', 'Update-JCUsersFromCSV', 'Get-JCEvent', + 'Get-JCEventCount' # 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 = @() @@ -120,7 +122,7 @@ PrivateData = @{ PSData = @{ # Tags applied to this module. These help with module discovery in online galleries. - Tags = 'JumpCloud', 'DaaS', 'Jump', 'Cloud', 'Directory' + Tags = 'JumpCloud','DaaS','Jump','Cloud','Directory' # A URL to the license for this module. LicenseUri = 'https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE' @@ -145,7 +147,7 @@ PrivateData = @{ } # End of PSData hashtable -} # End of PrivateData hashtable + } # End of PrivateData hashtable # HelpInfo URI of this module HelpInfoURI = 'https://github.com/TheJumpCloud/support/wiki' diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsElliott.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsElliott.Tests.ps1 new file mode 100644 index 000000000..e69de29bb diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsWrapped.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsWrapped.Tests.ps1 new file mode 100644 index 000000000..e69de29bb diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 13e8a890e..2840e1e16 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -7248,6 +7248,276 @@ + + + Get-JCSystemInsightsElliott + Get + JCSystemInsightsElliott + + {{ Fill in the Synopsis }} + + + + {{ Fill in the Description }} + + + + Get-JCSystemInsightsElliott + + Filter + + {{ Fill Filter Description }} + + System.String[] + + System.String[] + + + None + + + Sort + + {{ Fill Sort Description }} + + System.String[] + + System.String[] + + + None + + + Table + + {{ Fill Table Description }} + + System.String[] + + System.String[] + + + None + + + + + + Filter + + {{ Fill Filter Description }} + + System.String[] + + System.String[] + + + None + + + Sort + + {{ Fill Sort Description }} + + System.String[] + + System.String[] + + + None + + + Table + + {{ Fill Table Description }} + + System.String[] + + System.String[] + + + None + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + Online Version: + https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsightsElliott + + + + + + Get-JCSystemInsightsWrapped + Get + JCSystemInsightsWrapped + + + + + + {{ Fill in the Description }} + + + + Get-JCSystemInsightsWrapped + + Filter + + {{ Fill Filter Description }} + + System.String[] + + System.String[] + + + None + + + Sort + + {{ Fill Sort Description }} + + System.String[] + + System.String[] + + + None + + + Paginate + + {{ Fill Paginate Description }} + + System.Boolean + + System.Boolean + + + False + + + Table + + System Insights Table + + System.String + + System.String + + + None + + + + + + Filter + + {{ Fill Filter Description }} + + System.String[] + + System.String[] + + + None + + + Sort + + {{ Fill Sort Description }} + + System.String[] + + System.String[] + + + None + + + Paginate + + {{ Fill Paginate Description }} + + System.Boolean + + System.Boolean + + + False + + + Table + + System Insights Table + + System.String + + System.String + + + None + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + PS C:\> {{ Add example code here }} + + {{ Add example description here }} + + + + + + Online Version: + https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsightsWrapped + + + Get-JCSystemUser diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index 9e8656789..70ce1a9c5 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,19 +1,17 @@ #### Latest Version ``` -1.17.5 +1.18.0 ``` #### Banner Current ``` -Use Get-JCSystemInsight to query additional System Insights tables. -!!IF YOU RECEIVE AN ERROR WHILE UPDATING THE MODULE PLEASE RUN: Install-Module JumpCloud -force +{{Fill in the Banner Current}} ``` #### Banner Old ``` -Use Get-JCSystemInsight to query additional System Insights tables. -!!IF YOU RECEIVE AN ERROR WHILE UPDATING THE MODULE PLEASE RUN: Install-Module JumpCloud -force +{{Fill in the Banner Old}} ``` diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index dc6973231..ff56f4c09 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.18.0 + +Release Date: August 05, 2020 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.17.5 Release Date: July 20, 2020 From 1a83c6b51c89fe2c702255817140c7a87542601b Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 6 Aug 2020 08:09:06 -0600 Subject: [PATCH 08/51] add systeminsights --- .../Deploy/SdkSync/jcapiToSupportSync.ps1 | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 index de9c33f94..1d2a02a97 100644 --- a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 +++ b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 @@ -12,13 +12,13 @@ $ApprovedFunctions = [Ordered]@{ Name = 'Get-JcSdkEventCount' } ) - # 'JumpCloud.SDK.V2' = @( - # # Commented Out To Prevent Build - # [PSCustomObject]@{ - # Destination = 'Public/Systems' - # Name = 'Get-JcSdkSystemInsight*' - # } - # ) + 'JumpCloud.SDK.V2' = @( + # Commented Out To Prevent Build + [PSCustomObject]@{ + Destination = 'Public/Systems' + Name = 'Get-JcSdkSystemInsights' + } + ) } $SdkPrefix = 'JcSdk' $JumpCloudModulePrefix = 'JC' @@ -42,7 +42,8 @@ If (-not [System.String]::IsNullOrEmpty($Modules)) $FunctionDestination = $Function.Destination $OutputPath = "$JumpCloudModulePath/$FunctionDestination" $Command = Get-Command -Name:($FunctionName) - foreach ($individualCommand in $Command){ + foreach ($individualCommand in $Command) + { $CommandName = $individualCommand.Name $NewCommandName = $CommandName.Replace($SdkPrefix, $JumpCloudModulePrefix) Write-Host ("[STATUS] Building: $NewCommandName") -BackgroundColor:('Black') -ForegroundColor:('Magenta') From bacbbfa22f8cc20aca9d87b8874e367f5c3a8bc4 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 6 Aug 2020 10:09:59 -0600 Subject: [PATCH 09/51] cleanup systeminsights --- .../Deploy/SdkSync/jcapiToSupportSync.ps1 | 7 - PowerShell/JumpCloud Module/JumpCloud.psd1 | 212 +++++++++--------- .../Public/Systems/Get-JCSystemInsights.ps1 | 90 +++++--- .../Systems/Get-JCSystemInsightsElliott.ps1 | 80 ------- .../Systems/Get-JCSystemInsightsWrapped.ps1 | 78 ------- 5 files changed, 164 insertions(+), 303 deletions(-) delete mode 100644 PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 delete mode 100644 PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 diff --git a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 index 1d2a02a97..50caa9e0c 100644 --- a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 +++ b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 @@ -12,13 +12,6 @@ $ApprovedFunctions = [Ordered]@{ Name = 'Get-JcSdkEventCount' } ) - 'JumpCloud.SDK.V2' = @( - # Commented Out To Prevent Build - [PSCustomObject]@{ - Destination = 'Public/Systems' - Name = 'Get-JcSdkSystemInsights' - } - ) } $SdkPrefix = 'JcSdk' $JumpCloudModulePrefix = 'JC' diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 5b373ecd3..7fc8fc02c 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -8,152 +8,150 @@ @{ -# Script module or binary module file associated with this manifest. -RootModule = 'JumpCloud.psm1' + # Script module or binary module file associated with this manifest. + RootModule = 'JumpCloud.psm1' -# Version number of this module. -ModuleVersion = '1.18.0' + # Version number of this module. + ModuleVersion = '1.18.0' -# 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-JCRadiusReplyAttribute', 'Add-JCSystemGroupMember', - 'Add-JCSystemUser', 'Add-JCUserGroupMember', 'Connect-JCOnline', - 'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup', - '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-JCSystemGroupMember', - 'Get-JCSystemInsights', 'Get-JCSystemInsightsElliott', - 'Get-JCSystemInsightsWrapped', 'Get-JCSystemUser', 'Get-JCUser', - 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', - 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', - 'New-JCDeploymentTemplate', 'New-JCImportTemplate', - 'New-JCRadiusServer', 'New-JCSystemGroup', 'New-JCUser', - 'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand', - 'Remove-JCCommandResult', 'Remove-JCCommandTarget', - 'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer', - 'Remove-JCSystem', 'Remove-JCSystemGroup', - 'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser', - 'Remove-JCUserGroup', 'Remove-JCUserGroupMember', - 'Send-JCPasswordReset', 'Set-JCCommand', 'Set-JCOrganization', - 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', - 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', - 'Update-JCModule', 'Update-JCUsersFromCSV', 'Get-JCEvent', - 'Get-JCEventCount' + # 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-JCRadiusReplyAttribute', 'Add-JCSystemGroupMember', + 'Add-JCSystemUser', 'Add-JCUserGroupMember', 'Connect-JCOnline', + 'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup', + '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-JCSystemGroupMember', + 'Get-JCSystemInsights', 'Get-JCSystemUser', 'Get-JCUser', + 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', + 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', + 'New-JCDeploymentTemplate', 'New-JCImportTemplate', + 'New-JCRadiusServer', 'New-JCSystemGroup', 'New-JCUser', + 'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand', + 'Remove-JCCommandResult', 'Remove-JCCommandTarget', + 'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer', + 'Remove-JCSystem', 'Remove-JCSystemGroup', + 'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser', + 'Remove-JCUserGroup', 'Remove-JCUserGroupMember', + 'Send-JCPasswordReset', 'Set-JCCommand', 'Set-JCOrganization', + 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', + 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', + 'Update-JCModule', 'Update-JCUsersFromCSV', 'Get-JCEvent', + 'Get-JCEventCount' -# 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 = '' } - diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 50b1b1c53..0b9f1e9b7 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -1,44 +1,72 @@ +# Populate values for function parameters. "Dynamic ValidateSet" +$SystemInsightsPrefix = 'Get-JcSdkSystemInsight'; +$SystemInsightsTables = [Ordered]@{}; +$Commands = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($SystemInsightsPrefix)*"); +$Commands | ForEach-Object { + $Help = Get-Help -Name:($_.Name); + $SystemInsightsTables.Add($_.Name.Replace($SystemInsightsPrefix, ''), $Help.Description.Text + ' ' + $Help.parameters.parameter.Where( { $_.Name -eq 'filter' }).Description.Text + ' EX: {field}:{operator}:{searchValue}' ); +}; +Register-ArgumentCompleter -CommandName Get-JCSystemInsights -ParameterName Table -ScriptBlock { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + $FilterFilter = $fakeBoundParameter.Filter; + $SystemInsightsTables.Keys | Where-Object { $_ -like "${wordToComplete}*" } | Where-Object { $SystemInsightsTables.$_ -like "${FilterFilter}*" } | ForEach-Object { + New-Object System.Management.Automation.CompletionResult ( + $_, + $_, + 'ParameterValue', + $_ + ) + } +} +Register-ArgumentCompleter -CommandName Get-JCSystemInsights -ParameterName Filter -ScriptBlock { + param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) + $TypeFilter = $fakeBoundParameter.Table; + $SystemInsightsTables.Keys | Where-Object { $_ -like "${TypeFilter}*" } | ForEach-Object { $SystemInsightsTables.$_ | Where-Object { $_ -like "${wordToComplete}*" } } | Sort-Object -Unique | ForEach-Object { + New-Object System.Management.Automation.CompletionResult ( + $_, + $_, + 'ParameterValue', + $_ + ) + } +} Function Get-JCSystemInsights { - [CmdletBinding()] - Param() - DynamicParam - { - $Type = 'system' - $Action = 'get' - $JCTypes = Get-JCType | Where-Object { $_.TypeName.TypeNameSingular -eq $Type }; - $RuntimeParameterDictionary = New-DynamicParameter -Name:('Table') -Type:([System.String]) -Mandatory -ValueFromPipelineByPropertyName -ValidateNotNullOrEmpty -ParameterSets:('Default', 'ById', 'ByName', 'ByValue') -HelpMessage:('The SystemInsights table to query against.') -ValidateSet:($JCTypes.SystemInsights.Table); - Get-JCCommonParameters -Action:($Action) -Type:($Type) -RuntimeParameterDictionary:($RuntimeParameterDictionary) | Out-Null; - Return $RuntimeParameterDictionary - } + [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] + Param( + [Parameter(Mandatory)] + [System.String[]] + # Name of the SystemInsights table to query. See docs.jumpcloud.com for list of avalible table endpoints. + $Table, + + [Parameter()] + [System.String[]] + # Supported values and operators are specified for each table. See docs.jumpcloud.com and search for specific talbe for a list of avalible filter options. + ${Filter}, + + [Parameter()] + [System.String[]] + # The comma separated fields used to sort the collection. + # Default sort is ascending, prefix with `-` to sort descending. + ${Sort}, + + [Parameter(DontShow)] + [System.Boolean] + # Set to $true to return all results. This will overwrite any skip and limit parameter. + $Paginate = $true + ) Begin { - Connect-JCOnline -force | Out-Null - # Debug message for parameter call - $PSBoundParameters | Out-DebugParameter | Write-Debug $Results = @() } Process { - # For DynamicParam with a default value set that value and then convert the DynamicParam inputs into new variables for the script to use - Invoke-Command -ScriptBlock:($ScriptBlock_DefaultDynamicParamProcess) -ArgumentList:($PsBoundParameters, $PSCmdlet, $RuntimeParameterDictionary) -NoNewScope - Try - { - # Create hash table to store variables - $FunctionParameters = [ordered]@{ } - # Add input parameters from function in to hash table and filter out unnecessary parameters - $PSBoundParameters.GetEnumerator() | Where-Object { -not [System.String]::IsNullOrEmpty($_.Value) } | ForEach-Object { $FunctionParameters.Add($_.Key, $_.Value) | Out-Null } - $FunctionParameters.Add('Type', $JCTypes.TypeName.TypeNameSingular) | Out-Null - # Run the command - $Results += Get-JCObject @FunctionParameters - } - Catch - { - Write-Error ($_) - } + $PSBoundParameters.Remove('Table') | Out-Null + $Command = "JumpCloud.SDK.V2\Get-JcSdkSystemInsight$($Table) @PSBoundParameters" + $Results = Invoke-Expression -Command:($Command) } End { Return $Results } -} +} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 deleted file mode 100644 index fa643082e..000000000 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsElliott.ps1 +++ /dev/null @@ -1,80 +0,0 @@ -# Populate values for function parameters -$SystemInsightsPrefix = 'Get-JcSdkSystemInsight' -$SystemInsightsTables = @{} -$Commands = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$SystemInsightsPrefix*") -ForEach ($Command In $Commands) -{ - $Help = Get-Help -Name:($Command) - $SystemInsightsTables.Add($Command.Name.Replace($SystemInsightsPrefix, ''), $Help.Description.Text + ' ' + $Help.parameters.parameter.Where( { $_.Name -eq 'filter' }).Description.Text + ' EX: {field}:{operator}:{searchValue}' ) -} -Register-ArgumentCompleter -CommandName Get-JCSystemInsightsElliott -ParameterName Table -ScriptBlock { - param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) - $FilterFilter = $fakeBoundParameter.Filter - $SystemInsightsTables.Keys | Where-Object { $_ -like "${wordToComplete}*" } | Where-Object { - $SystemInsightsTables.$_ -like "${FilterFilter}*" - } | ForEach-Object { - New-Object System.Management.Automation.CompletionResult ( - $_, - $_, - 'ParameterValue', - $_ - ) - } -} -Register-ArgumentCompleter -CommandName Get-JCSystemInsightsElliott -ParameterName Filter -ScriptBlock { - param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) - $TypeFilter = $fakeBoundParameter.Table - $SystemInsightsTables.Keys | Where-Object { $_ -like "${TypeFilter}*" } | ForEach-Object { $SystemInsightsTables.$_ | - Where-Object { $_ -like "${wordToComplete}*" } } | - Sort-Object -Unique | ForEach-Object { - New-Object System.Management.Automation.CompletionResult ( - $_, - $_, - 'ParameterValue', - $_ - ) - } -} -Function Get-JCSystemInsightsElliott -{ - [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] - Param( - [Parameter(Mandatory)] - [JumpCloud.SDK.V2.Category('Query')] - [System.String[]] - # Name of the SystemInsights table to query. See docs.jumpcloud.com for list of avalible table endpoints. - $Table, - - [Parameter()] - [JumpCloud.SDK.V2.Category('Query')] - [System.String[]] - # Supported operators are: eq - ${Filter}, - - [Parameter()] - [JumpCloud.SDK.V2.Category('Query')] - [System.String[]] - # The comma separated fields used to sort the collection. - # Default sort is ascending, prefix with `-` to sort descending. - ${Sort}, - - [Parameter(DontShow)] - [System.Boolean] - # Set to $true to return all results. This will overwrite any skip and limit parameter. - $Paginate = $true - ) - Begin - { - $Results = @() - } - Process - { - $PSBoundParameters.Remove('Table') | Out-Null - $Command = "JumpCloud.SDK.V2\Get-JcSdkSystemInsight$Table @PSBoundParameters" - $Results = Invoke-Expression -Command:($Command) - } - End - { - Return $Results - } -} \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 deleted file mode 100644 index 3b00679ff..000000000 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsightsWrapped.ps1 +++ /dev/null @@ -1,78 +0,0 @@ -function Get-JCSystemInsightsWrapped{ - [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] - param( - [string[]] - ${Filter}, - [string[]] - ${Sort}, - [bool] - ${Paginate}) - DynamicParam{ - $dict = New-Object System.Management.Automation.RuntimeDefinedParameterDictionary - $attr = New-Object System.Management.Automation.ParameterAttribute - $attr.HelpMessage = "System Insights Table" - $attr.ValueFromPipelineByPropertyName = $true - $attrColl = New-Object System.Collections.ObjectModel.Collection[System.Attribute] - $attrColl.Add($attr) - # $attrColl.Add((New-Object System.Management.Automation.ValidateSetAttribute(Get-ChildItem -Path '/Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsight*' | Select-Object -ExpandProperty BaseName))) - # $attrColl.Add((New-Object System.Management.Automation.ValidateSetAttribute(Get-Command -Module JumpCloud.SDK.V2 | Where-Object Name -Match "Get-JcSdkSystemInsight*" | Select-Object -ExpandProperty Name))) - $attrColl.Add((New-Object System.Management.Automation.ValidateSetAttribute(Get-Command -Module JumpCloud.SDK.V2 | Where-Object Name -Match "Get-JcSdkSystemInsight*" | ForEach-Object { $_ -replace "Get-JcSdkSystemInsight*", "" }))) - $param = New-Object System.Management.Automation.RuntimeDefinedParameter('Table', [string], $attrColl) - $dict.Add('Table', $param) - # Write-Host($dict) - return $dict - } - begin { - try { - $outBuffer = $null - if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { - $PSBoundParameters['OutBuffer'] = 1 - } - if ($PSBoundParameters["Table"]){ - $Table = $PSBoundParameters["Table"] - } - $InsightsCommandFull = "Get-JcSdkSystemInsight" + "$Table" - $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand($InsightsCommandFull, [System.Management.Automation.CommandTypes]::Function) - Write-Host ($wrappedCmd) - foreach ($item in $PSBoundParameters){ - if ($item.Keys -notin $wrappedCmd.Parameters.Keys){ - $PSBoundParameters.Remove($item.Keys) | Out-Null - } - } - $scriptCmd = { & $wrappedCmd @PSBoundParameters } - $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) - $steppablePipeline.Begin($PSCmdlet) - } - catch { - throw - } - } - process { - try { - $steppablePipeline.Process($_) - } - catch { - throw - } - } - end { - try { - $steppablePipeline.End() - } - catch { - throw - } - } - <# - .ForwardHelpTargetName $InsightsCommandFull - .ForwardHelpCategory Function - #> -} -# $scriptBlock = { Get-ChildItem -Path 'C:\Program Files' | Select-Object -ExpandProperty Name2 } -# # Get-ChildItem -Path '/Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsight*' | Select-Object -ExpandProperty Name -# $scriptblock = { -# param($commandName, $parameterName, $stringMatch) -# Get-ChildItem -Path '/Users/jworkman/Documents/GitHub/support/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsight*' | Select-Object -ExpandProperty BaseName - -# } - From 211dc1510f078a8fb120b32d3bc612a0a1ec5a08 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 6 Aug 2020 15:39:20 -0600 Subject: [PATCH 10/51] add id parameter --- .../Public/Systems/Get-JCSystemInsights.ps1 | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 0b9f1e9b7..6dc9e8648 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -35,14 +35,19 @@ Function Get-JCSystemInsights [CmdletBinding(DefaultParameterSetName = 'List', PositionalBinding = $false)] Param( [Parameter(Mandatory)] - [System.String[]] + [System.String] # Name of the SystemInsights table to query. See docs.jumpcloud.com for list of avalible table endpoints. $Table, [Parameter()] - [System.String[]] + [Alias('_id', 'id', 'system_id')] + # Id of system to filter on. + [System.String]$SystemId, + + [Parameter()] + [System.String] # Supported values and operators are specified for each table. See docs.jumpcloud.com and search for specific talbe for a list of avalible filter options. - ${Filter}, + $Filter, [Parameter()] [System.String[]] @@ -58,10 +63,20 @@ Function Get-JCSystemInsights Begin { $Results = @() + If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.systemId)) + { + $SystemIdFilter = "system_id:eq:$($PSBoundParameters.systemId)" + If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.Filter)) + { + $SystemIdFilter = "$($SystemIdFilter),$($PSBoundParameters.Filter)" + } + $PSBoundParameters.Filter = $SystemIdFilter + } } Process { $PSBoundParameters.Remove('Table') | Out-Null + $PSBoundParameters.Remove('SystemId') | Out-Null $Command = "JumpCloud.SDK.V2\Get-JcSdkSystemInsight$($Table) @PSBoundParameters" $Results = Invoke-Expression -Command:($Command) } From dd6520e350410cb0e5109de8b5d956a09cb06f55 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Fri, 7 Aug 2020 09:04:40 -0600 Subject: [PATCH 11/51] inital fix for systeminsights tests --- .../Systems/Get-JCSystemInsights.Tests.ps1 | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 index ff3e7572e..cdeeb5bdd 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 @@ -1,13 +1,18 @@ BeforeAll { Connect-JCOnline -JumpCloudApiKey:($PesterParams_ApiKey) -force | Out-Null $ErrorActionPreference = 'Stop' # Continue (Default), Ignore, Inquire, SilentlyContinue, Stop, Suspend - } Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { Function Get-JCSystemInsightsTestCases($System) { # Retrieve objects to test with - $TableNames = $PesterParams_SystemInsightsTables | Where-Object { $_ -notin ('disk_info', 'bitlocker_info', 'uptime', 'sip_config', 'alf', 'shared_resources', 'user_ssh_keys', 'user_groups', 'sharing_preferences', 'scheduled_tasks', 'alf_exceptions') } # HACK Temp workaround because these tables don't take strings as filters + $SystemInsightsPrefix = 'Get-JcSdkSystemInsight'; + $SystemInsightsTables = @(); + $Commands = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($SystemInsightsPrefix)*") | select-object name; + $Commands | ForEach-Object { + $SystemInsightsTables += ($_.Name.Replace($SystemInsightsPrefix, '')) + } + $TableNames = $SystemInsightsTables | Where-Object { $_ -notin ('DiskInfo', 'WindowCrash', 'BitlockerInfo', 'Uptime', 'SipConfig', 'Alf', 'SharedResource', 'UserSshKey', 'UserGroup', 'SharingPreference', 'ScheduledTask', 'AlfException') } # HACK Temp workaround because these tables don't take strings as filters $SystemInsightsTestCases = @() $TableNames | ForEach-Object { $TableName = $_ @@ -17,16 +22,16 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { } $SystemInsightsTestCases += @{ testDescription = "Test table '$TableName' across specified systems ById where error is NullOrEmpty." - Command = "Get-JCSystemInsights -Table:('$TableName') -Id:('$(($System._id) -join "','")');" + Command = "Get-JCSystemInsights -Table:('$TableName') -Id:('$(($System[0]._id))');" } # $SystemInsightsTestCases += @{ # testDescription = "Test table '$TableName' across specified systems ByValue Id where error is NullOrEmpty." # Command = "Get-JCSystemInsights -Table:('$TableName') -SearchBy:('ById') -SearchByValue:('$(($System._id) -join "','")');" # } - $SystemInsightsTestCases += @{ - testDescription = "Test table '$TableName' across specified systems ByName where error is NullOrEmpty." - Command = "Get-JCSystemInsights -Table:('$TableName') -Name:('$(($System.displayName) -join "','")');" - } + # $SystemInsightsTestCases += @{ + # testDescription = "Test table '$TableName' across specified systems ByName where error is NullOrEmpty." + # Command = "Get-JCSystemInsights -Table:('$TableName') -Name:('$(($System.displayName) -join "','")');" + # } # $SystemInsightsTestCases += @{ # testDescription = "Test table '$TableName' across specified systems ByValue Name where error is NullOrEmpty." # Command = "Get-JCSystemInsights -Table:('$TableName') -SearchBy:('ByName') -SearchByValue:('$(($System.displayName) -join "','")');" From daa109b0a25f521eaf11f8083af86ade552e3609 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Fri, 7 Aug 2020 15:31:44 +0000 Subject: [PATCH 12/51] Push to refs/heads/SA-1275_Get-JCSystemInsights_SDK;[skip ci] --- .../Docs/Get-JCSystemInsights.md | 118 ++------ PowerShell/JumpCloud Module/JumpCloud.psd1 | 213 +++++++------- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 274 ++---------------- PowerShell/ModuleBanner.md | 2 +- PowerShell/ModuleChangelog.md | 22 ++ 5 files changed, 169 insertions(+), 460 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md index 8a0fe53d7..ae29b7d31 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md @@ -15,28 +15,9 @@ systems. ## SYNTAX -### Default ``` -Get-JCSystemInsights -Table [[-Fields] ] [[-Filter] ] [[-Limit] ] - [[-Skip] ] [[-Paginate] ] [] -``` - -### ById -``` -Get-JCSystemInsights -Table [-Id] [[-Fields] ] [[-Filter] ] - [[-Limit] ] [[-Skip] ] [[-Paginate] ] [] -``` - -### ByName -``` -Get-JCSystemInsights -Table [-Name] [[-Fields] ] [[-Filter] ] - [[-Limit] ] [[-Skip] ] [[-Paginate] ] [] -``` - -### ByValue -``` -Get-JCSystemInsights -Table [[-Fields] ] [[-Filter] ] [[-Limit] ] - [[-Skip] ] [[-Paginate] ] [] +Get-JCSystemInsights -Table [-SystemId ] [[-Filter] ] [-Sort ] + [] ``` ## DESCRIPTION @@ -89,21 +70,6 @@ Filters the users table for any system with the username jcadmin. ## PARAMETERS -### -Fields -An array of the fields/properties/columns you want to return from the search. - -```yaml -Type: System.Array -Parameter Sets: (All) -Aliases: - -Required: False -Position: 95 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -Filter Filters to narrow down search. @@ -115,99 +81,53 @@ Aliases: Required: False Position: 96 Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` -### -Id -The unique id of the object. - -```yaml -Type: System.String[] -Parameter Sets: ById -Aliases: _id - -Required: True -Position: 1 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Limit -The number of items you want to return per API call. +### -Table +The SystemInsights table to query against. ```yaml -Type: System.Int32 +Type: System.String Parameter Sets: (All) Aliases: - -Required: False -Position: 97 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Name -The name of the object. - -```yaml -Type: System.String[] -Parameter Sets: ByName -Aliases: displayName +Accepted values: battery, managed_policies, sip_config, alf, crashes, usb_devices, ie_extensions, launchd, shared_folders, shared_resources, user_ssh_keys, logged_in_users, shadow, sharing_preferences, user_groups, kernel_info, system_controls, uptime, etc_hosts, logical_drives, disk_info, bitlocker_info, patches, programs, apps, browser_plugins, chrome_extensions, disk_encryption, firefox_addons, groups, interface_addresses, mounts, os_version, safari_extensions, system_info, users, certificates, cups_destinations, interface_details, python_packages, registry, scheduled_tasks, services, startup_items, authorized_keys, appcompat_shims, dns_resolvers, wifi_networks, wifi_status, connectivity, windows_security_products, alf_exceptions, alf_explicit_auths Required: True -Position: 1 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - -### -Paginate -Whether or not you want to paginate through the results. - -```yaml -Type: System.Boolean -Parameter Sets: (All) -Aliases: -Accepted values: True, False - -Required: False -Position: 99 +Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` -### -Skip -The number of items you want to skip over per API call. +### -Sort +{{ Fill Sort Description }} ```yaml -Type: System.Int32 +Type: System.String[] Parameter Sets: (All) Aliases: Required: False -Position: 98 +Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` -### -Table -The SystemInsights table to query against. +### -SystemId +{{ Fill SystemId Description }} ```yaml Type: System.String Parameter Sets: (All) -Aliases: -Accepted values: battery, managed_policies, sip_config, alf, crashes, usb_devices, ie_extensions, launchd, shared_folders, shared_resources, user_ssh_keys, logged_in_users, shadow, sharing_preferences, user_groups, kernel_info, system_controls, uptime, etc_hosts, logical_drives, disk_info, bitlocker_info, patches, programs, apps, browser_plugins, chrome_extensions, disk_encryption, firefox_addons, groups, interface_addresses, mounts, os_version, safari_extensions, system_info, users, certificates, cups_destinations, interface_details, python_packages, registry, scheduled_tasks, services, startup_items, authorized_keys, appcompat_shims, dns_resolvers, wifi_networks, wifi_status, connectivity, windows_security_products, alf_exceptions, alf_explicit_auths +Aliases: _id, id, system_id -Required: True +Required: False Position: Named Default value: None -Accept pipeline input: True (ByPropertyName) +Accept pipeline input: False Accept wildcard characters: False ``` diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 7fc8fc02c..18bebb5d2 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,155 +3,156 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 8/5/2020 +# Generated on: 8/7/2020 # @{ - # Script module or binary module file associated with this manifest. - RootModule = 'JumpCloud.psm1' +# Script module or binary module file associated with this manifest. +RootModule = 'JumpCloud.psm1' - # Version number of this module. - ModuleVersion = '1.18.0' +# Version number of this module. +ModuleVersion = '1.17.6' - # 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-JCRadiusReplyAttribute', 'Add-JCSystemGroupMember', - 'Add-JCSystemUser', 'Add-JCUserGroupMember', 'Connect-JCOnline', - 'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup', - '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-JCSystemGroupMember', - 'Get-JCSystemInsights', 'Get-JCSystemUser', 'Get-JCUser', - 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', - 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', - 'New-JCDeploymentTemplate', 'New-JCImportTemplate', - 'New-JCRadiusServer', 'New-JCSystemGroup', 'New-JCUser', - 'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand', - 'Remove-JCCommandResult', 'Remove-JCCommandTarget', - 'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer', - 'Remove-JCSystem', 'Remove-JCSystemGroup', - 'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser', - 'Remove-JCUserGroup', 'Remove-JCUserGroupMember', - 'Send-JCPasswordReset', 'Set-JCCommand', 'Set-JCOrganization', - 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', - 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', - 'Update-JCModule', 'Update-JCUsersFromCSV', 'Get-JCEvent', - 'Get-JCEventCount' +# 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-JCRadiusReplyAttribute', 'Add-JCSystemGroupMember', + 'Add-JCSystemUser', 'Add-JCUserGroupMember', 'Connect-JCOnline', + 'Copy-JCAssociation', 'Get-JCAssociation', 'Get-JCBackup', + '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-JCSystemGroupMember', + 'Get-JCSystemInsights', 'Get-JCSystemUser', 'Get-JCUser', + 'Get-JCUserGroupMember', 'Import-JCCommand', 'Import-JCUsersFromCSV', + 'Invoke-JCCommand', 'Invoke-JCDeployment', 'New-JCCommand', + 'New-JCDeploymentTemplate', 'New-JCImportTemplate', + 'New-JCRadiusServer', 'New-JCSystemGroup', 'New-JCUser', + 'New-JCUserGroup', 'Remove-JCAssociation', 'Remove-JCCommand', + 'Remove-JCCommandResult', 'Remove-JCCommandTarget', + 'Remove-JCRadiusReplyAttribute', 'Remove-JCRadiusServer', + 'Remove-JCSystem', 'Remove-JCSystemGroup', + 'Remove-JCSystemGroupMember', 'Remove-JCSystemUser', 'Remove-JCUser', + 'Remove-JCUserGroup', 'Remove-JCUserGroupMember', + 'Send-JCPasswordReset', 'Set-JCCommand', 'Set-JCOrganization', + 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', + 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', + 'Update-JCModule', 'Update-JCUsersFromCSV', 'Get-JCEvent', + 'Get-JCEventCount' - # 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 = '' } + diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 2840e1e16..ebead47e9 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -6751,31 +6751,7 @@ Get-JCSystemInsights - - Id - - The unique id of the object. - - System.String[] - - System.String[] - - - None - - - Fields - - An array of the fields/properties/columns you want to return from the search. - - System.Array - - System.Array - - - None - - + Filter Filters to narrow down search. @@ -6787,47 +6763,7 @@ None - - Limit - - The number of items you want to return per API call. - - System.Int32 - - System.Int32 - - - None - - - Skip - - The number of items you want to skip over per API call. - - System.Int32 - - System.Int32 - - - None - - - Paginate - - Whether or not you want to paginate through the results. - - - True - False - - System.Boolean - - System.Boolean - - - None - - + Table The SystemInsights table to query against. @@ -6894,13 +6830,10 @@ None - - - Get-JCSystemInsights - - Name + + Sort - The name of the object. + {{ Fill Sort Description }} System.String[] @@ -6909,130 +6842,11 @@ None - - Fields - - An array of the fields/properties/columns you want to return from the search. - - System.Array - - System.Array - - - None - - - Filter - - Filters to narrow down search. - - System.String - - System.String - - - None - - - Limit - - The number of items you want to return per API call. - - System.Int32 - - System.Int32 - - - None - - - Skip - - The number of items you want to skip over per API call. - - System.Int32 - - System.Int32 - - - None - - - Paginate - - Whether or not you want to paginate through the results. - - - True - False - - System.Boolean - - System.Boolean - - - None - - - Table + + SystemId - The SystemInsights table to query against. + {{ Fill SystemId Description }} - - battery - managed_policies - sip_config - alf - crashes - usb_devices - ie_extensions - launchd - shared_folders - shared_resources - user_ssh_keys - logged_in_users - shadow - sharing_preferences - user_groups - kernel_info - system_controls - uptime - etc_hosts - logical_drives - disk_info - bitlocker_info - patches - programs - apps - browser_plugins - chrome_extensions - disk_encryption - firefox_addons - groups - interface_addresses - mounts - os_version - safari_extensions - system_info - users - certificates - cups_destinations - interface_details - python_packages - registry - scheduled_tasks - services - startup_items - authorized_keys - appcompat_shims - dns_resolvers - wifi_networks - wifi_status - connectivity - windows_security_products - alf_exceptions - alf_explicit_auths - System.String System.String @@ -7043,19 +6857,7 @@ - - Fields - - An array of the fields/properties/columns you want to return from the search. - - System.Array - - System.Array - - - None - - + Filter Filters to narrow down search. @@ -7067,34 +6869,22 @@ None - - Id - - The unique id of the object. - - System.String[] - - System.String[] - - - None - - - Limit + + Table - The number of items you want to return per API call. + The SystemInsights table to query against. - System.Int32 + System.String - System.Int32 + System.String None - - Name + + Sort - The name of the object. + {{ Fill Sort Description }} System.String[] @@ -7103,34 +6893,10 @@ None - - Paginate + + SystemId - Whether or not you want to paginate through the results. - - System.Boolean - - System.Boolean - - - None - - - Skip - - The number of items you want to skip over per API call. - - System.Int32 - - System.Int32 - - - None - - - Table - - The SystemInsights table to query against. + {{ Fill SystemId Description }} System.String diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index 70ce1a9c5..e2e44aeb8 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,7 +1,7 @@ #### Latest Version ``` -1.18.0 +1.17.6 ``` #### Banner Current diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index ff56f4c09..53b2c3d79 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.17.6 + +Release Date: August 07, 2020 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.18.0 Release Date: August 05, 2020 From 5db6f5c571708f05e9237470490c865e1094f486 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Fri, 7 Aug 2020 09:42:59 -0600 Subject: [PATCH 13/51] Add BuildNuspec --- PowerShell/Deploy/BuildNuspecFromPsd1.ps1 | 155 ++++++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 PowerShell/Deploy/BuildNuspecFromPsd1.ps1 diff --git a/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 b/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 new file mode 100644 index 000000000..64f52f922 --- /dev/null +++ b/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 @@ -0,0 +1,155 @@ +. ($PSScriptRoot + '/' + 'Get-Config.ps1') + +# Set Variables for New-NuspecFile +$ManifestPath = "$($FilePath_psd1)" +$OutputPath = "$($FolderPath_Module)" +$Psd1 = Import-PowerShellDataFile -Path:($ManifestPath) +$Id = $(Get-Item ($ManifestPath)).BaseName +$Version = $Psd1.ModuleVersion +$Description = $Psd1.Description +$Authors = $Psd1.Author +$Owners = $Psd1.CompanyName +$ReleaseNotes = $Psd1.PrivateData.PSData.ReleaseNotes +$Copyright = $Psd1.Copyright +$Tags = $Psd1.PrivateData.PSData.Tags +$LicenseUrl = $Psd1.PrivateData.PSData.LicenseUri +$ProjectUrl = $Psd1.PrivateData.PSData.ProjectUri +$IconUrl = $Psd1.PrivateData.PSData.IconUri +$Dependencies = $Psd1.RequiredModules + +# Addapted from PowerShell Get +# https://github.com/PowerShell/PowerShellGetv2/blob/7de99ee0c38611556e5c583ffaca98bb1922a0d4/src/PowerShellGet/private/functions/New-NuspecFile.ps1 +function New-NuspecFile { + [CmdletBinding()] + Param( + [Parameter(Mandatory = $true)] + [string]$OutputPath, + + [Parameter(Mandatory = $true)] + [string]$Id, + + [Parameter(Mandatory = $true)] + [string]$Version, + + [Parameter(Mandatory = $true)] + [string]$Description, + + [Parameter(Mandatory = $true)] + [string[]]$Authors, + + [Parameter()] + [string[]]$Owners, + + [Parameter()] + [string]$ReleaseNotes, + + [Parameter()] + [bool]$RequireLicenseAcceptance, + + [Parameter()] + [string]$Copyright, + + [Parameter()] + [string[]]$Tags, + + [Parameter()] + [string]$LicenseUrl, + + [Parameter()] + [string]$ProjectUrl, + + [Parameter()] + [string]$IconUrl, + + [Parameter()] + [PSObject[]]$Dependencies, + + [Parameter()] + [PSObject[]]$Files + + ) + Set-StrictMode -Off + + Write-Verbose "Calling New-NuspecFile" + + $nameSpaceUri = "http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd" + [xml]$xml = New-Object System.Xml.XmlDocument + + $xmlDeclaration = $xml.CreateXmlDeclaration("1.0", "utf-8", $null) + $xml.AppendChild($xmlDeclaration) | Out-Null + + #create top-level elements + $packageElement = $xml.CreateElement("package", $nameSpaceUri) + $metaDataElement = $xml.CreateElement("metadata", $nameSpaceUri) + + # warn we're over 4000 characters for standard nuget servers + $tagsString = $Tags -Join " " + if ($tagsString.Length -gt 4000) { + Write-Warning -Message "Tag list exceeded 4000 characters and may not be accepted by some Nuget feeds." + } + + $metaDataElementsHash = [ordered]@{ + id = $Id + version = $Version + description = $Description + authors = $Authors -Join "," + owners = $Owners -Join "," + releaseNotes = $ReleaseNotes + requireLicenseAcceptance = $RequireLicenseAcceptance.ToString().ToLower() + copyright = $Copyright + tags = $tagsString + } + + if ($LicenseUrl) { $metaDataElementsHash.Add("licenseUrl", $LicenseUrl) } + if ($ProjectUrl) { $metaDataElementsHash.Add("projectUrl", $ProjectUrl) } + if ($IconUrl) { $metaDataElementsHash.Add("iconUrl", $IconUrl) } + + foreach ($key in $metaDataElementsHash.Keys) { + $element = $xml.CreateElement($key, $nameSpaceUri) + $elementInnerText = $metaDataElementsHash.item($key) + $element.InnerText = $elementInnerText + + $metaDataElement.AppendChild($element) | Out-Null + } + + + if ($Dependencies) { + $dependenciesElement = $xml.CreateElement("dependencies", $nameSpaceUri) + + foreach ($dependency in $Dependencies) { + $element = $xml.CreateElement("dependency", $nameSpaceUri) + # $element. + $element.SetAttribute("id", $dependency) + if ($dependency.version) { $element.SetAttribute("version", $dependency.version) } + + $dependenciesElement.AppendChild($element) | Out-Null + } + $metaDataElement.AppendChild($dependenciesElement) | Out-Null + } + + if ($Files) { + $filesElement = $xml.CreateElement("files", $nameSpaceUri) + + foreach ($file in $Files) { + $element = $xml.CreateElement("file", $nameSpaceUri) + $element.SetAttribute("src", $file.src) + if ($file.target) { $element.SetAttribute("target", $file.target) } + if ($file.exclude) { $element.SetAttribute("exclude", $file.exclude) } + + $filesElement.AppendChild($element) | Out-Null + } + } + + $packageElement.AppendChild($metaDataElement) | Out-Null + if ($filesElement) { $packageElement.AppendChild($filesElement) | Out-Null } + + $xml.AppendChild($packageElement) | Out-Null + + $nuspecFullName = Join-Path -Path $OutputPath -ChildPath "$Id.nuspec" + $xml.save($nuspecFullName) + + Write-Output $nuspecFullName +} + + +New-NuspecFile -OutputPath $OutputPath -Id $Id -Version $Version -Description $Description -Authors $Authors -Owners $Owners -ReleaseNotes $ReleaseNotes -Copyright $Copyright -Tags $Tags -LicenseUrl $LicenseUrl -ProjectUrl $ProjectUrl -IconUrl $IconUrl -Dependencies $Dependencies \ No newline at end of file From c665d2b7004ef69ce012c465c4dea725a903ff86 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 09:52:37 -0600 Subject: [PATCH 14/51] allow for array of strings --- .../Public/Systems/Get-JCSystemInsights.ps1 | 41 +++++++++++++------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 6dc9e8648..149bc394f 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -40,12 +40,13 @@ Function Get-JCSystemInsights $Table, [Parameter()] + [System.String[]] [Alias('_id', 'id', 'system_id')] # Id of system to filter on. - [System.String]$SystemId, + $SystemId, [Parameter()] - [System.String] + [System.String[]] # Supported values and operators are specified for each table. See docs.jumpcloud.com and search for specific talbe for a list of avalible filter options. $Filter, @@ -62,23 +63,39 @@ Function Get-JCSystemInsights ) Begin { + $CommandTemplate = "JumpCloud.SDK.V2\Get-JcSdkSystemInsight{0} @PSBoundParameters" $Results = @() - If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.systemId)) + $PSBoundParameters.Filter = $PSBoundParameters.Filter -replace (', ', ',') -join ',' + If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.SystemId)) { - $SystemIdFilter = "system_id:eq:$($PSBoundParameters.systemId)" - If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.Filter)) - { - $SystemIdFilter = "$($SystemIdFilter),$($PSBoundParameters.Filter)" + $SystemIdFilter = $PSBoundParameters.SystemId | ForEach-Object { + $SystemIdFilterString = "system_id:eq:$($_)" + If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.Filter)) + { + "$($SystemIdFilterString),$($PSBoundParameters.Filter)" + } + Else + { + $SystemIdFilterString + } } - $PSBoundParameters.Filter = $SystemIdFilter } + $PSBoundParameters.Remove('Table') | Out-Null + $PSBoundParameters.Remove('SystemId') | Out-Null } Process { - $PSBoundParameters.Remove('Table') | Out-Null - $PSBoundParameters.Remove('SystemId') | Out-Null - $Command = "JumpCloud.SDK.V2\Get-JcSdkSystemInsight$($Table) @PSBoundParameters" - $Results = Invoke-Expression -Command:($Command) + $Results = If (-not [System.String]::IsNullOrEmpty($SystemIdFilter)) + { + $SystemIdFilter | ForEach-Object { + $PSBoundParameters.Filter = $_ + Invoke-Expression -Command:($CommandTemplate -f $Table) + } + } + Else + { + Invoke-Expression -Command:($CommandTemplate -f $Table) + } } End { From 305f57dd313b38591c8fccb29cdecb9df2865a1e Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 09:52:53 -0600 Subject: [PATCH 15/51] cleanup --- .../Tests/Public/Systems/Get-JCSystemInsightsElliott.Tests.ps1 | 0 .../Tests/Public/Systems/Get-JCSystemInsightsWrapped.Tests.ps1 | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsElliott.Tests.ps1 delete mode 100644 PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsWrapped.Tests.ps1 diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsElliott.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsElliott.Tests.ps1 deleted file mode 100644 index e69de29bb..000000000 diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsWrapped.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsightsWrapped.Tests.ps1 deleted file mode 100644 index e69de29bb..000000000 From 905139492e70e081a129631fa78b5c156a612150 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 10:16:19 -0600 Subject: [PATCH 16/51] only add filter when its populated --- .../JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 149bc394f..392d68e7f 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -65,7 +65,10 @@ Function Get-JCSystemInsights { $CommandTemplate = "JumpCloud.SDK.V2\Get-JcSdkSystemInsight{0} @PSBoundParameters" $Results = @() - $PSBoundParameters.Filter = $PSBoundParameters.Filter -replace (', ', ',') -join ',' + If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.Filter)) + { + $PSBoundParameters.Filter = $PSBoundParameters.Filter -replace (', ', ',') -join ',' + } If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.SystemId)) { $SystemIdFilter = $PSBoundParameters.SystemId | ForEach-Object { From 6694933f63394bda86755e9036c0de3a8df7b202 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Fri, 7 Aug 2020 11:50:24 -0600 Subject: [PATCH 17/51] test for filter on multiple system ids --- .../Systems/Get-JCSystemInsights.Tests.ps1 | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 index cdeeb5bdd..78dca7d75 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 @@ -14,6 +14,14 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { } $TableNames = $SystemInsightsTables | Where-Object { $_ -notin ('DiskInfo', 'WindowCrash', 'BitlockerInfo', 'Uptime', 'SipConfig', 'Alf', 'SharedResource', 'UserSshKey', 'UserGroup', 'SharingPreference', 'ScheduledTask', 'AlfException') } # HACK Temp workaround because these tables don't take strings as filters $SystemInsightsTestCases = @() + foreach ($sys in $System) { + if ($sys -eq $System[-1]) { + $filterString += "system_id:eq:$($sys._id)" + } + else{ + $filterString += "system_id:eq:$($sys._id)," + } + } $TableNames | ForEach-Object { $TableName = $_ $SystemInsightsTestCases += @{ @@ -21,13 +29,13 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { Command = "Get-JCSystemInsights -Table:('$TableName');" } $SystemInsightsTestCases += @{ - testDescription = "Test table '$TableName' across specified systems ById where error is NullOrEmpty." - Command = "Get-JCSystemInsights -Table:('$TableName') -Id:('$(($System[0]._id))');" + testDescription = "Test table '$TableName' across specified systems through Id param where error is NullOrEmpty." + Command = "Get-JCSystemInsights -Table:('$TableName') -Id:('$(($System._id) -join "','")');" + } + $SystemInsightsTestCases += @{ + testDescription = "Test table '$TableName' across specified systems through filter param where error is NullOrEmpty." + Command = "Get-JCSystemInsights -Table:('$TableName') -Filter:('$filterString');" } - # $SystemInsightsTestCases += @{ - # testDescription = "Test table '$TableName' across specified systems ByValue Id where error is NullOrEmpty." - # Command = "Get-JCSystemInsights -Table:('$TableName') -SearchBy:('ById') -SearchByValue:('$(($System._id) -join "','")');" - # } # $SystemInsightsTestCases += @{ # testDescription = "Test table '$TableName' across specified systems ByName where error is NullOrEmpty." # Command = "Get-JCSystemInsights -Table:('$TableName') -Name:('$(($System.displayName) -join "','")');" @@ -40,7 +48,7 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { Return $SystemInsightsTestCases } It '' -TestCases:(Get-JCSystemInsightsTestCases -System:($PesterParams_SystemLinux, $PesterParams_SystemMac, $PesterParams_SystemWindows)) { - # Write-Host ("Command: $Command") + Write-Host ("Command: $Command") $CommandResults = Invoke-Expression -Command:($Command) -ErrorVariable:('CommandResultsError') $CommandResultsError | Should -BeNullOrEmpty } From 20e81f17773785ace9fcfd1ec66446bfaecb3bf9 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Fri, 7 Aug 2020 18:14:48 +0000 Subject: [PATCH 18/51] Push to refs/heads/SA-1275_Get-JCSystemInsights_SDK;[skip ci] --- .../Docs/Get-JCSystemInsights.md | 6 +++--- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md index ae29b7d31..551edb76a 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md @@ -16,7 +16,7 @@ systems. ## SYNTAX ``` -Get-JCSystemInsights -Table [-SystemId ] [[-Filter] ] [-Sort ] +Get-JCSystemInsights -Table [-SystemId ] [[-Filter] ] [-Sort ] [] ``` @@ -74,7 +74,7 @@ Filters the users table for any system with the username jcadmin. Filters to narrow down search. ```yaml -Type: System.String +Type: System.String[] Parameter Sets: (All) Aliases: @@ -120,7 +120,7 @@ Accept wildcard characters: False {{ Fill SystemId Description }} ```yaml -Type: System.String +Type: System.String[] Parameter Sets: (All) Aliases: _id, id, system_id diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index ebead47e9..386a93aaf 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -6756,9 +6756,9 @@ Filters to narrow down search. - System.String + System.String[] - System.String + System.String[] None @@ -6847,9 +6847,9 @@ {{ Fill SystemId Description }} - System.String + System.String[] - System.String + System.String[] None @@ -6862,9 +6862,9 @@ Filters to narrow down search. - System.String + System.String[] - System.String + System.String[] None @@ -6898,9 +6898,9 @@ {{ Fill SystemId Description }} - System.String + System.String[] - System.String + System.String[] None From 0e847d8f9ecbd6f60e043b28aa662a3ba0c74fbc Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 12:16:26 -0600 Subject: [PATCH 19/51] update release notes --- PowerShell/ModuleChangelog.md | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 53b2c3d79..5721a46c6 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -5,29 +5,15 @@ Release Date: August 07, 2020 #### RELEASE NOTES ``` -{{Fill in the Release Notes}} -``` - -#### FEATURES: - -{{Fill in the Features}} - -#### IMPROVEMENTS: - -{{Fill in the Improvements}} - -#### BUG FIXES: - -{{Fill in the Bug Fixes}} - -## 1.18.0 - -Release Date: August 05, 2020 - -#### RELEASE NOTES - -``` -{{Fill in the Release Notes}} +`Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module. +Feature Enhancements + New SystemInsights tables will be automatically added they become available. + By using tab complete on the `-Filter` parameter and example of how to build the filter will be populated. +Breaking Changes + Table names will no longer contain special characters. + The object returned from the function its properties will not contain special characters. + Table names are singular instead of plural. + Dropping the `-Name` parameter to increase performance. ``` #### FEATURES: From e4775c7e0f2cd937156f1866264a8beb49f4c736 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 12:46:10 -0600 Subject: [PATCH 20/51] update systeminsights documentaion --- .../Docs/Get-JCSystemInsights.md | 149 ------------------ .../Docs/Get-JCSystemInsightsElliott.md | 90 ----------- .../Docs/Get-JCSystemInsightsWrapped.md | 102 ------------ .../Public/Systems/Get-JCSystemInsights.ps1 | 33 ++++ 4 files changed, 33 insertions(+), 341 deletions(-) delete mode 100644 PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md delete mode 100644 PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsElliott.md delete mode 100644 PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsWrapped.md diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md deleted file mode 100644 index 551edb76a..000000000 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -external help file: JumpCloud-help.xml -Module Name: JumpCloud -online version: https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsights -schema: 2.0.0 ---- - -# Get-JCSystemInsights - -## SYNOPSIS -JumpCloud's System Insights feature provides admins with the ability to easily interrogate their -fleet of systems to find important pieces of information. Using this function you -can easily gather heightened levels of information from your fleet of JumpCloud managed -systems. - -## SYNTAX - -``` -Get-JCSystemInsights -Table [-SystemId ] [[-Filter] ] [-Sort ] - [] -``` - -## DESCRIPTION -Using Get-JCSystemInsights will allow you to easily query JumpCloud's RESTful API to return information from your fleet of JumpCloud managed -systems. - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> Get-JCSystemInsights -Table:('os_version'); -``` - -Return os_version data for all systems that have system insights enabled. - -### Example 2 -```powershell -PS C:\> Get-JCSystemInsights -Table:('os_version') -Id:('5d0917420905f70e36e3c0d3'); -``` - -Return os_version data for a system with a specified id. - -### Example 3 -```powershell -PS C:\> Get-JCSystemInsights -Table:('os_version') -Id:('5d0917420905f70e36e3c0d3', '5d0bc68b8e41442ccd10254a'); -``` - -Return os_version data for systems with specific ids. - -### Example 4 -```powershell -PS C:\> Get-JCSystemInsights -Table:('os_version') -Name:('MacBook-Pro.local_TEST'); -``` - -Return os_version data for a system with a specified name. - -### Example 5 -```powershell -PS C:\> Get-JCSystemInsights -Table:('os_version') -Name:('MacBook-Pro.local_TEST', 'Holly-Flax-Mac.local_TEST'); -``` - -Return os_version data for systems with specific names. - -### Example 6 -```powershell -PS C:\> Get-JCSystemInsights -Table users -Filter username:eq:jcadmin -``` - -Filters the users table for any system with the username jcadmin. - -## PARAMETERS - -### -Filter -Filters to narrow down search. - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: 96 -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Table -The SystemInsights table to query against. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: -Accepted values: battery, managed_policies, sip_config, alf, crashes, usb_devices, ie_extensions, launchd, shared_folders, shared_resources, user_ssh_keys, logged_in_users, shadow, sharing_preferences, user_groups, kernel_info, system_controls, uptime, etc_hosts, logical_drives, disk_info, bitlocker_info, patches, programs, apps, browser_plugins, chrome_extensions, disk_encryption, firefox_addons, groups, interface_addresses, mounts, os_version, safari_extensions, system_info, users, certificates, cups_destinations, interface_details, python_packages, registry, scheduled_tasks, services, startup_items, authorized_keys, appcompat_shims, dns_resolvers, wifi_networks, wifi_status, connectivity, windows_security_products, alf_exceptions, alf_explicit_auths - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Sort -{{ Fill Sort Description }} - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -SystemId -{{ Fill SystemId Description }} - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: _id, id, system_id - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -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[] -### System.Array -### System.Int32 -### System.Boolean -## OUTPUTS - -### System.Object -## NOTES - -## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsElliott.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsElliott.md deleted file mode 100644 index c71ccc148..000000000 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsElliott.md +++ /dev/null @@ -1,90 +0,0 @@ ---- -external help file: JumpCloud-help.xml -Module Name: JumpCloud -online version: https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsightsElliott -schema: 2.0.0 ---- - -# Get-JCSystemInsightsElliott - -## SYNOPSIS -{{ Fill in the Synopsis }} - -## SYNTAX - -``` -Get-JCSystemInsightsElliott -Table [-Filter ] [-Sort ] [] -``` - -## DESCRIPTION -{{ Fill in the Description }} - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -Filter -{{ Fill Filter Description }} - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Sort -{{ Fill Sort Description }} - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Table -{{ Fill Table Description }} - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: True -Position: Named -Default value: None -Accept pipeline input: False -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 - -### None - -## OUTPUTS - -### System.Object -## NOTES - -## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsWrapped.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsWrapped.md deleted file mode 100644 index b79e105d6..000000000 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsightsWrapped.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -external help file: JumpCloud-help.xml -Module Name: JumpCloud -online version: https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsightsWrapped -schema: 2.0.0 ---- - -# Get-JCSystemInsightsWrapped - -## SYNOPSIS - -## SYNTAX - -``` -Get-JCSystemInsightsWrapped [-Filter ] [-Sort ] [-Paginate ] [-Table ] - [] -``` - -## DESCRIPTION -{{ Fill in the Description }} - -## EXAMPLES - -### Example 1 -```powershell -PS C:\> {{ Add example code here }} -``` - -{{ Add example description here }} - -## PARAMETERS - -### -Filter -{{ Fill Filter Description }} - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Sort -{{ Fill Sort Description }} - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Paginate -{{ Fill Paginate Description }} - -```yaml -Type: System.Boolean -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: False -Accept pipeline input: False -Accept wildcard characters: False -``` - -### -Table -System Insights Table - -```yaml -Type: System.String -Parameter Sets: (All) -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 - -## OUTPUTS - -## NOTES - -## RELATED LINKS diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 392d68e7f..0f920308c 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -1,3 +1,36 @@ +<# +.Synopsis +JumpCloud's System Insights feature provides admins with the ability to easily interrogate their +fleet of systems to find important pieces of information. Using this function you +can easily gather heightened levels of information from your fleet of JumpCloud managed +systems. +.Description +Using Get-JCSystemInsights will allow you to easily query JumpCloud's RESTful API to return information from your fleet of JumpCloud managed +systems. + +.Example +PS C:\> Get-JCSystemInsights -Table:('App'); + +Get all Apps from systems with system insights enabled. + +.Example +PS C:\> Get-JCSystemInsights -Table:('App') -SystemId:('5d66e0ac51db1e789bb17c77', '5e0e19831bc893319ae068b6'); + +Get all Apps from the specific systems. + +.Example +PS C:\> Get-JCSystemInsights -Table:('App') -Filter:('system_id:eq:5d66e0ac51db1e789bb17c77', 'bundle_name:eq:storeuid'); + +Get systems that have a specific App on a specific system where the filter is multiple strings. + +.Example +PS C:\> Get-JCSystemInsights -Table:('App') -Filter:('system_id:eq:5d66e0ac51db1e789bb17c77, bundle_name:eq:storeuid'); + +Get systems that have a specific App on a specific system where the filter is a string. + +.Link +https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsights +#> # Populate values for function parameters. "Dynamic ValidateSet" $SystemInsightsPrefix = 'Get-JcSdkSystemInsight'; $SystemInsightsTables = [Ordered]@{}; From 4166e5cfba5ce75076c900ec1a67488c29e90f98 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Fri, 7 Aug 2020 19:31:05 +0000 Subject: [PATCH 21/51] Push to refs/heads/SA-1275_Get-JCSystemInsights_SDK;[skip ci] --- .../Docs/Get-JCSystemInsights.md | 149 ++++++++++ PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 270 ------------------ PowerShell/ModuleBanner.md | 2 +- PowerShell/ModuleChangelog.md | 22 ++ 5 files changed, 173 insertions(+), 272 deletions(-) create mode 100644 PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md new file mode 100644 index 000000000..4e24b46b6 --- /dev/null +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md @@ -0,0 +1,149 @@ +--- +external help file: JumpCloud-help.xml +Module Name: JumpCloud +online version: https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsights +schema: 2.0.0 +--- + +# Get-JCSystemInsights + +## SYNOPSIS +JumpCloud's System Insights feature provides admins with the ability to easily interrogate their fleet of systems to find important pieces of information. +Using this function you can easily gather heightened levels of information from your fleet of JumpCloud managed systems. + +## SYNTAX + +``` +Get-JCSystemInsights -Table [-SystemId ] [[-Filter] ] [-Sort ] + [] +``` + +## DESCRIPTION +Using Get-JCSystemInsights will allow you to easily query JumpCloud's RESTful API to return information from your fleet of JumpCloud managed systems. + +## EXAMPLES + +### Example 1 +``` +PS C:\> Get-JCSystemInsights -Table:('os_version'); +``` + +Return os_version data for all systems that have system insights enabled. + +### Example 2 +``` +PS C:\> Get-JCSystemInsights -Table:('os_version') -Id:('5d0917420905f70e36e3c0d3'); +``` + +Return os_version data for a system with a specified id. + +### Example 3 +``` +PS C:\> Get-JCSystemInsights -Table:('os_version') -Id:('5d0917420905f70e36e3c0d3', '5d0bc68b8e41442ccd10254a'); +``` + +Return os_version data for systems with specific ids. + +### Example 4 +``` +PS C:\> Get-JCSystemInsights -Table:('os_version') -Name:('MacBook-Pro.local_TEST'); +``` + +Return os_version data for a system with a specified name. + +### Example 5 +``` +PS C:\> Get-JCSystemInsights -Table:('os_version') -Name:('MacBook-Pro.local_TEST', 'Holly-Flax-Mac.local_TEST'); +``` + +Return os_version data for systems with specific names. + +### Example 6 +``` +PS C:\> Get-JCSystemInsights -Table users -Filter username:eq:jcadmin +``` + +Filters the users table for any system with the username jcadmin. + +## PARAMETERS + +### -Filter +Filters to narrow down search. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: 96 +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Table +The SystemInsights table to query against. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: +Accepted values: battery, managed_policies, sip_config, alf, crashes, usb_devices, ie_extensions, launchd, shared_folders, shared_resources, user_ssh_keys, logged_in_users, shadow, sharing_preferences, user_groups, kernel_info, system_controls, uptime, etc_hosts, logical_drives, disk_info, bitlocker_info, patches, programs, apps, browser_plugins, chrome_extensions, disk_encryption, firefox_addons, groups, interface_addresses, mounts, os_version, safari_extensions, system_info, users, certificates, cups_destinations, interface_details, python_packages, registry, scheduled_tasks, services, startup_items, authorized_keys, appcompat_shims, dns_resolvers, wifi_networks, wifi_status, connectivity, windows_security_products, alf_exceptions, alf_explicit_auths + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Sort +{{ Fill Sort Description }} + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SystemId +{{ Fill SystemId Description }} + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: _id, id, system_id + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +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[] +### System.Array +### System.Int32 +### System.Boolean +## OUTPUTS + +### System.Object +## NOTES + +## RELATED LINKS + +[Online Version:](https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsights) + diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 18bebb5d2..94e0ef0d4 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -12,7 +12,7 @@ RootModule = 'JumpCloud.psm1' # Version number of this module. -ModuleVersion = '1.17.6' +ModuleVersion = '1.18.0' # Supported PSEditions # CompatiblePSEditions = @() diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 386a93aaf..51461ce0a 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -7014,276 +7014,6 @@ - - - Get-JCSystemInsightsElliott - Get - JCSystemInsightsElliott - - {{ Fill in the Synopsis }} - - - - {{ Fill in the Description }} - - - - Get-JCSystemInsightsElliott - - Filter - - {{ Fill Filter Description }} - - System.String[] - - System.String[] - - - None - - - Sort - - {{ Fill Sort Description }} - - System.String[] - - System.String[] - - - None - - - Table - - {{ Fill Table Description }} - - System.String[] - - System.String[] - - - None - - - - - - Filter - - {{ Fill Filter Description }} - - System.String[] - - System.String[] - - - None - - - Sort - - {{ Fill Sort Description }} - - System.String[] - - System.String[] - - - None - - - Table - - {{ Fill Table Description }} - - System.String[] - - System.String[] - - - None - - - - - - None - - - - - - - - - - System.Object - - - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - Online Version: - https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsightsElliott - - - - - - Get-JCSystemInsightsWrapped - Get - JCSystemInsightsWrapped - - - - - - {{ Fill in the Description }} - - - - Get-JCSystemInsightsWrapped - - Filter - - {{ Fill Filter Description }} - - System.String[] - - System.String[] - - - None - - - Sort - - {{ Fill Sort Description }} - - System.String[] - - System.String[] - - - None - - - Paginate - - {{ Fill Paginate Description }} - - System.Boolean - - System.Boolean - - - False - - - Table - - System Insights Table - - System.String - - System.String - - - None - - - - - - Filter - - {{ Fill Filter Description }} - - System.String[] - - System.String[] - - - None - - - Sort - - {{ Fill Sort Description }} - - System.String[] - - System.String[] - - - None - - - Paginate - - {{ Fill Paginate Description }} - - System.Boolean - - System.Boolean - - - False - - - Table - - System Insights Table - - System.String - - System.String - - - None - - - - - - - - - - - - -------------------------- Example 1 -------------------------- - PS C:\> {{ Add example code here }} - - {{ Add example description here }} - - - - - - Online Version: - https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsightsWrapped - - - Get-JCSystemUser diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index e2e44aeb8..70ce1a9c5 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -1,7 +1,7 @@ #### Latest Version ``` -1.17.6 +1.18.0 ``` #### Banner Current diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 5721a46c6..3a1168e42 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,3 +1,25 @@ +## 1.18.0 + +Release Date: August 07, 2020 + +#### RELEASE NOTES + +``` +{{Fill in the Release Notes}} +``` + +#### FEATURES: + +{{Fill in the Features}} + +#### IMPROVEMENTS: + +{{Fill in the Improvements}} + +#### BUG FIXES: + +{{Fill in the Bug Fixes}} + ## 1.17.6 Release Date: August 07, 2020 From b8975087c0f6161582257a6b8e5ad331d6e57a43 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Fri, 7 Aug 2020 13:49:04 -0600 Subject: [PATCH 22/51] update systeminsights tests --- .../Systems/Get-JCSystemInsights.Tests.ps1 | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 index 78dca7d75..15868e21a 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 @@ -14,14 +14,14 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { } $TableNames = $SystemInsightsTables | Where-Object { $_ -notin ('DiskInfo', 'WindowCrash', 'BitlockerInfo', 'Uptime', 'SipConfig', 'Alf', 'SharedResource', 'UserSshKey', 'UserGroup', 'SharingPreference', 'ScheduledTask', 'AlfException') } # HACK Temp workaround because these tables don't take strings as filters $SystemInsightsTestCases = @() - foreach ($sys in $System) { - if ($sys -eq $System[-1]) { - $filterString += "system_id:eq:$($sys._id)" - } - else{ - $filterString += "system_id:eq:$($sys._id)," - } - } + # foreach ($sys in $System) { + # if ($sys -eq $System[-1]) { + # $filterString += "system_id:eq:$($sys._id)" + # } + # else{ + # $filterString += "system_id:eq:$($sys._id)," + # } + # } $TableNames | ForEach-Object { $TableName = $_ $SystemInsightsTestCases += @{ @@ -34,7 +34,7 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { } $SystemInsightsTestCases += @{ testDescription = "Test table '$TableName' across specified systems through filter param where error is NullOrEmpty." - Command = "Get-JCSystemInsights -Table:('$TableName') -Filter:('$filterString');" + Command = "Get-JCSystemInsights -Table:('$TableName') -Filter:('system_id:eq:$($System[0]._id)');" } # $SystemInsightsTestCases += @{ # testDescription = "Test table '$TableName' across specified systems ByName where error is NullOrEmpty." @@ -48,7 +48,7 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { Return $SystemInsightsTestCases } It '' -TestCases:(Get-JCSystemInsightsTestCases -System:($PesterParams_SystemLinux, $PesterParams_SystemMac, $PesterParams_SystemWindows)) { - Write-Host ("Command: $Command") + # Write-Host ("Command: $Command") $CommandResults = Invoke-Expression -Command:($Command) -ErrorVariable:('CommandResultsError') $CommandResultsError | Should -BeNullOrEmpty } From 4a16e57b8c277692c54dbdb97bce23bc6d0ee1bf Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Fri, 7 Aug 2020 13:52:29 -0600 Subject: [PATCH 23/51] clean up get-jcsysteminsights.tests --- .../Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 | 8 -------- 1 file changed, 8 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 index 15868e21a..9f986da13 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 @@ -14,14 +14,6 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { } $TableNames = $SystemInsightsTables | Where-Object { $_ -notin ('DiskInfo', 'WindowCrash', 'BitlockerInfo', 'Uptime', 'SipConfig', 'Alf', 'SharedResource', 'UserSshKey', 'UserGroup', 'SharingPreference', 'ScheduledTask', 'AlfException') } # HACK Temp workaround because these tables don't take strings as filters $SystemInsightsTestCases = @() - # foreach ($sys in $System) { - # if ($sys -eq $System[-1]) { - # $filterString += "system_id:eq:$($sys._id)" - # } - # else{ - # $filterString += "system_id:eq:$($sys._id)," - # } - # } $TableNames | ForEach-Object { $TableName = $_ $SystemInsightsTestCases += @{ From 9ffe6e3273c9393aafa1dd15d32b016b1cc6005b Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 14:12:42 -0600 Subject: [PATCH 24/51] update tab completion --- .../Public/Systems/Get-JCSystemInsights.ps1 | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 0f920308c..8650b2ad3 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -33,16 +33,34 @@ https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsights #> # Populate values for function parameters. "Dynamic ValidateSet" $SystemInsightsPrefix = 'Get-JcSdkSystemInsight'; -$SystemInsightsTables = [Ordered]@{}; -$Commands = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($SystemInsightsPrefix)*"); -$Commands | ForEach-Object { +$SystemInsightsDataSet = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($SystemInsightsPrefix)*") | ForEach-Object { $Help = Get-Help -Name:($_.Name); - $SystemInsightsTables.Add($_.Name.Replace($SystemInsightsPrefix, ''), $Help.Description.Text + ' ' + $Help.parameters.parameter.Where( { $_.Name -eq 'filter' }).Description.Text + ' EX: {field}:{operator}:{searchValue}' ); + $Table = $_.Name.Replace($SystemInsightsPrefix, '') + $HelpDescription = $Help.Description.Text + $FilterDescription = $Help.parameters.parameter.Where( { $_.Name -eq 'filter' }).Description.Text + $FilterNames = ($HelpDescription | Select-String -Pattern:([Regex]'(?<=\ `)(.*?)(?=\`)') -AllMatches).Matches.Value + $Operators = ($FilterDescription -Replace ('Supported operators are: ', '')).Trim() + If ([System.String]::IsNullOrEmpty($HelpDescription) -or [System.String]::IsNullOrEmpty($FilterNames) -or [System.String]::IsNullOrEmpty($Operators)) + { + Write-Error ('Get-JCSystemInsights parameter help info is missing.') + } + Else + { + $FilterNames | ForEach-Object { + $FilterName = $_ + $Operators | ForEach-Object { + $Operator = $_ + @{ + $Table = ("'{0}:{1}:{2}'" -f $FilterName, $Operator, '[SearchValue ]') + } + } + } + } }; Register-ArgumentCompleter -CommandName Get-JCSystemInsights -ParameterName Table -ScriptBlock { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) $FilterFilter = $fakeBoundParameter.Filter; - $SystemInsightsTables.Keys | Where-Object { $_ -like "${wordToComplete}*" } | Where-Object { $SystemInsightsTables.$_ -like "${FilterFilter}*" } | ForEach-Object { + $SystemInsightsDataSet.Keys | Where-Object { $_ -like "${wordToComplete}*" } | Where-Object { $SystemInsightsDataSet.$_ -like "${FilterFilter}*" } | ForEach-Object { New-Object System.Management.Automation.CompletionResult ( $_, $_, @@ -54,7 +72,7 @@ Register-ArgumentCompleter -CommandName Get-JCSystemInsights -ParameterName Tabl Register-ArgumentCompleter -CommandName Get-JCSystemInsights -ParameterName Filter -ScriptBlock { param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter) $TypeFilter = $fakeBoundParameter.Table; - $SystemInsightsTables.Keys | Where-Object { $_ -like "${TypeFilter}*" } | ForEach-Object { $SystemInsightsTables.$_ | Where-Object { $_ -like "${wordToComplete}*" } } | Sort-Object -Unique | ForEach-Object { + $SystemInsightsDataSet.Keys | Where-Object { $_ -like "${TypeFilter}*" } | ForEach-Object { $SystemInsightsDataSet.$_ | Where-Object { $_ -like "${wordToComplete}*" } } | Sort-Object -Unique | ForEach-Object { New-Object System.Management.Automation.CompletionResult ( $_, $_, @@ -69,7 +87,8 @@ Function Get-JCSystemInsights Param( [Parameter(Mandatory)] [System.String] - # Name of the SystemInsights table to query. See docs.jumpcloud.com for list of avalible table endpoints. + # Name of the SystemInsights table to query. + # See docs.jumpcloud.com for list of avalible table endpoints. $Table, [Parameter()] @@ -80,7 +99,9 @@ Function Get-JCSystemInsights [Parameter()] [System.String[]] - # Supported values and operators are specified for each table. See docs.jumpcloud.com and search for specific talbe for a list of avalible filter options. + # Supported values and operators are specified for each table. + # See docs.jumpcloud.com and search for specific table for a list of avalible filter options. + # Use tab complete to see avalible filters. $Filter, [Parameter()] From 886f87c1cab5913ba6205a149f565d3b2cf332ff Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 14:39:51 -0600 Subject: [PATCH 25/51] update how hash table is built --- .../Public/Systems/Get-JCSystemInsights.ps1 | 10 ++-- .../Systems/Get-JCSystemInsights.Tests.ps1 | 49 ++++++++++++------- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 8650b2ad3..4d5bbb2fd 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -33,7 +33,8 @@ https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsights #> # Populate values for function parameters. "Dynamic ValidateSet" $SystemInsightsPrefix = 'Get-JcSdkSystemInsight'; -$SystemInsightsDataSet = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($SystemInsightsPrefix)*") | ForEach-Object { +$SystemInsightsDataSet = [Ordered]@{} +Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($SystemInsightsPrefix)*") | ForEach-Object { $Help = Get-Help -Name:($_.Name); $Table = $_.Name.Replace($SystemInsightsPrefix, '') $HelpDescription = $Help.Description.Text @@ -46,15 +47,14 @@ $SystemInsightsDataSet = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($Sys } Else { - $FilterNames | ForEach-Object { + $Filters = $FilterNames | ForEach-Object { $FilterName = $_ $Operators | ForEach-Object { $Operator = $_ - @{ - $Table = ("'{0}:{1}:{2}'" -f $FilterName, $Operator, '[SearchValue ]') - } + ("'{0}:{1}:{2}'" -f $FilterName, $Operator, '[SearchValue ]'); } } + $SystemInsightsDataSet.Add($Table, $Filters ) } }; Register-ArgumentCompleter -CommandName Get-JCSystemInsights -ParameterName Table -ScriptBlock { diff --git a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 index 9f986da13..8313702ac 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/Systems/Get-JCSystemInsights.Tests.ps1 @@ -7,15 +7,33 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { { # Retrieve objects to test with $SystemInsightsPrefix = 'Get-JcSdkSystemInsight'; - $SystemInsightsTables = @(); - $Commands = Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($SystemInsightsPrefix)*") | select-object name; - $Commands | ForEach-Object { - $SystemInsightsTables += ($_.Name.Replace($SystemInsightsPrefix, '')) - } - $TableNames = $SystemInsightsTables | Where-Object { $_ -notin ('DiskInfo', 'WindowCrash', 'BitlockerInfo', 'Uptime', 'SipConfig', 'Alf', 'SharedResource', 'UserSshKey', 'UserGroup', 'SharingPreference', 'ScheduledTask', 'AlfException') } # HACK Temp workaround because these tables don't take strings as filters + $SystemInsightsDataSet = [Ordered]@{} + Get-Command -Module:('JumpCloud.SDK.V2') -Name:("$($SystemInsightsPrefix)*") | ForEach-Object { + $Help = Get-Help -Name:($_.Name); + $Table = $_.Name.Replace($SystemInsightsPrefix, '') + $HelpDescription = $Help.Description.Text + $FilterDescription = $Help.parameters.parameter.Where( { $_.Name -eq 'filter' }).Description.Text + $FilterNames = ($HelpDescription | Select-String -Pattern:([Regex]'(?<=\ `)(.*?)(?=\`)') -AllMatches).Matches.Value + $Operators = ($FilterDescription -Replace ('Supported operators are: ', '')).Trim() + If ([System.String]::IsNullOrEmpty($HelpDescription) -or [System.String]::IsNullOrEmpty($FilterNames) -or [System.String]::IsNullOrEmpty($Operators)) + { + Write-Error ('Get-JCSystemInsights parameter help info is missing.') + } + Else + { + $Filters = $FilterNames | ForEach-Object { + $FilterName = $_ + $Operators | ForEach-Object { + $Operator = $_ + ("'{0}:{1}:{2}'" -f $FilterName, $Operator, '[SearchValue ]'); + } + } + $SystemInsightsDataSet.Add($Table, $Filters ) + } + }; $SystemInsightsTestCases = @() - $TableNames | ForEach-Object { - $TableName = $_ + $SystemInsightsDataSet.GetEnumerator() | ForEach-Object { + $TableName = $_.Key $SystemInsightsTestCases += @{ testDescription = "Test table '$TableName' across all systems where error is NullOrEmpty." Command = "Get-JCSystemInsights -Table:('$TableName');" @@ -24,17 +42,12 @@ Describe -Tag:('JCSystemInsights') "Get-JCSystemInsights Tests" { testDescription = "Test table '$TableName' across specified systems through Id param where error is NullOrEmpty." Command = "Get-JCSystemInsights -Table:('$TableName') -Id:('$(($System._id) -join "','")');" } - $SystemInsightsTestCases += @{ - testDescription = "Test table '$TableName' across specified systems through filter param where error is NullOrEmpty." - Command = "Get-JCSystemInsights -Table:('$TableName') -Filter:('system_id:eq:$($System[0]._id)');" - } - # $SystemInsightsTestCases += @{ - # testDescription = "Test table '$TableName' across specified systems ByName where error is NullOrEmpty." - # Command = "Get-JCSystemInsights -Table:('$TableName') -Name:('$(($System.displayName) -join "','")');" - # } + # Use this if we decide to test the `-Filter` parameter eventually. + # $Filter = $_.Value | Where-Object { $_ -like '%*system_id*%' } # Only test system_id filter since we dont know the values to search for in the other filters. + # $Filter = $Filter.replace('[SearchValue ]', $System[0]._id) # $SystemInsightsTestCases += @{ - # testDescription = "Test table '$TableName' across specified systems ByValue Name where error is NullOrEmpty." - # Command = "Get-JCSystemInsights -Table:('$TableName') -SearchBy:('ByName') -SearchByValue:('$(($System.displayName) -join "','")');" + # testDescription = "Test table '$TableName' across specified systems through filter param where error is NullOrEmpty." + # Command = "Get-JCSystemInsights -Table:('$TableName') -Filter:('$($Filter)');" # } } Return $SystemInsightsTestCases From eeedd16bc421820d2cebb96c1e278d6b0db185c6 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 14:48:59 -0600 Subject: [PATCH 26/51] remove unused vars --- PowerShell/JumpCloud Module/Tests/SetupOrg.ps1 | 3 --- 1 file changed, 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/SetupOrg.ps1 b/PowerShell/JumpCloud Module/Tests/SetupOrg.ps1 index ba9e849cd..12889d989 100644 --- a/PowerShell/JumpCloud Module/Tests/SetupOrg.ps1 +++ b/PowerShell/JumpCloud Module/Tests/SetupOrg.ps1 @@ -79,9 +79,6 @@ $PesterParamsHash_BuildOrg = @{ SystemWindows = Get-JCSystem -displayName:($PesterParams_SystemNameWindows) CommandResults = Get-JCCommandResult } -$PesterParamsHash_CommonDynamic = @{ - SystemInsightsTables = (Get-JCType -Type:('system')).SystemInsights.Table -} $PesterParamsHash_Associations = @{ UserGroupMembership = Add-JCUserGroupMember -GroupName:($PesterParamsHash_BuildOrg.UserGroup.Name) -Username:($PesterParamsHash_BuildOrg.User1.username); PolicySystemGroupMembership = $PesterParamsHash_BuildOrg.MultiplePolicy | ForEach-Object { New-JCAssociation -Type:('policy') -Id:($_.id) -TargetType:('system_group') -TargetId:($PesterParamsHash_BuildOrg.SystemGroup.id) -force }; From 121b7aa3084fd23401554f7d56f8b7c6d7103b78 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Fri, 7 Aug 2020 15:16:42 -0600 Subject: [PATCH 27/51] update release notes [skip ci] --- PowerShell/ModuleBanner.md | 4 ++-- PowerShell/ModuleChangelog.md | 22 ---------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index 70ce1a9c5..dd1b1b805 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -7,11 +7,11 @@ #### Banner Current ``` -{{Fill in the Banner Current}} +`Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module. ``` #### Banner Old ``` -{{Fill in the Banner Old}} +`Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module. ``` diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 3a1168e42..594d81400 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -4,28 +4,6 @@ Release Date: August 07, 2020 #### RELEASE NOTES -``` -{{Fill in the Release Notes}} -``` - -#### FEATURES: - -{{Fill in the Features}} - -#### IMPROVEMENTS: - -{{Fill in the Improvements}} - -#### BUG FIXES: - -{{Fill in the Bug Fixes}} - -## 1.17.6 - -Release Date: August 07, 2020 - -#### RELEASE NOTES - ``` `Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module. Feature Enhancements From 0fb38455bc3578db4812bd9837e0f551abade1d8 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 12 Aug 2020 10:35:15 -0600 Subject: [PATCH 28/51] Release Notes and Bug Fixes --- PowerShell/ModuleChangelog.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 594d81400..61362b434 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,6 +1,6 @@ ## 1.18.0 -Release Date: August 07, 2020 +Release Date: August 12, 2020 #### RELEASE NOTES @@ -18,15 +18,15 @@ Breaking Changes #### FEATURES: -{{Fill in the Features}} +Get-JCSystemInsights Tables are independent of the JumpCloud Module, pulled automatically from JumpCloud.SDK.V2 Module +Get-JCEvent and Get-JCEvent MTP API Key functionality +Remove Depreciated SystemInsights Windows Crashes Table. #### IMPROVEMENTS: -{{Fill in the Improvements}} - #### BUG FIXES: -{{Fill in the Bug Fixes}} +Get-JCEvents and Get-JCEvent functions should now work with MTP API Keys ## 1.17.5 From 73c18f4969fd03390855be4d8b27a68861d8dbfe Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 12 Aug 2020 11:09:25 -0600 Subject: [PATCH 29/51] require versions of SDKs --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 94e0ef0d4..b22df3faa 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -51,9 +51,17 @@ PowerShellVersion = '4.0' # 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') +RequiredModules = @( + @{ ModuleName = 'JumpCloud.SDK.DirectoryInsights' + ModuleVersion = '0.0.8' + }, + @{ ModuleName = 'JumpCloud.SDK.V1' + ModuleVersion = '0.0.14' + }, + @{ ModuleName = 'JumpCloud.SDK.V2' + ModuleVersion = '0.0.19' + } +) # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() From bf689430ea4795340a561500cac5eb0f53919b1e Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 12 Aug 2020 13:00:59 -0600 Subject: [PATCH 30/51] build by version --- PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 b/PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 index 7dcee9b8c..eb6c5fd46 100755 --- a/PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 +++ b/PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 @@ -93,13 +93,13 @@ Function New-JCModuleManifest $FunctionParameters.RequiredModules | ForEach-Object { If ([System.String]::IsNullOrEmpty((Get-InstalledModule).Where( { $_.Name -eq $_ }))) { - Write-Host ('Installing: ' + $_) - Install-Module -Name:($_) -Force + Write-Host ('Installing: ' + $_.ModuleName) + Install-Module -Name:($_.ModuleName) -RequiredVersion:($_.ModuleVersion) -Force } If (!(Get-Module -Name:($_))) { - Write-Host ('Importing: ' + $_) - Import-Module -Name:($_) -Force + Write-Host ('Importing: ' + $_.ModuleName) + Import-Module -Name:($_.ModuleName) -RequiredVersion:($_.ModuleVersion) -Force } } } From f7c76d2120ac0ed2a1a66a8b396c740c41bf657e Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 12 Aug 2020 13:09:34 -0600 Subject: [PATCH 31/51] jcapitosupport from required modules --- PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 index 50caa9e0c..7358e6201 100644 --- a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 +++ b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 @@ -21,9 +21,9 @@ $Divider = '|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|' $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 = (Get-Item -Path:($PSScriptRoot)).Parent.Parent.FullName + '/JumpCloud Module' -Import-Module -Name:($RequiredModules) +Import-Module -Name:($RequiredModules.ModuleName) Get-Module -Refresh -ListAvailable -All | Out-Null -$Modules = Get-Module -Name:($RequiredModules | Where-Object { $_ -in $ApprovedFunctions.Keys }) +$Modules = Get-Module -Name:($RequiredModules.ModuleName | Where-Object { $_ -in $ApprovedFunctions.Keys }) If (-not [System.String]::IsNullOrEmpty($Modules)) { ForEach ($Module In $Modules) From 0451cff0798fbc3021933318f23c383b8ea995b4 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Wed, 12 Aug 2020 19:15:10 +0000 Subject: [PATCH 32/51] Push to refs/heads/SA-1275_Get-JCSystemInsights_SDK;[skip ci] --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index b22df3faa..abc7e08aa 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 8/7/2020 +# Generated on: 8/12/2020 # @{ @@ -51,17 +51,9 @@ PowerShellVersion = '4.0' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( - @{ ModuleName = 'JumpCloud.SDK.DirectoryInsights' - ModuleVersion = '0.0.8' - }, - @{ ModuleName = 'JumpCloud.SDK.V1' - ModuleVersion = '0.0.14' - }, - @{ ModuleName = 'JumpCloud.SDK.V2' - ModuleVersion = '0.0.19' - } -) +RequiredModules = @(@{ModuleName = 'JumpCloud.SDK.DirectoryInsights'; ModuleVersion = '0.0.8'; }, + @{ModuleName = 'JumpCloud.SDK.V1'; ModuleVersion = '0.0.14'; }, + @{ModuleName = 'JumpCloud.SDK.V2'; ModuleVersion = '0.0.19'; }) # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() From e5393f99006b5b13fabbd94b0106971de7571bff Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 12 Aug 2020 13:29:02 -0600 Subject: [PATCH 33/51] testing with preRelease Modules --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index b22df3faa..057105834 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 8/7/2020 +# Generated on: 8/12/2020 # @{ @@ -51,17 +51,11 @@ PowerShellVersion = '4.0' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( - @{ ModuleName = 'JumpCloud.SDK.DirectoryInsights' - ModuleVersion = '0.0.8' - }, - @{ ModuleName = 'JumpCloud.SDK.V1' - ModuleVersion = '0.0.14' - }, - @{ ModuleName = 'JumpCloud.SDK.V2' - ModuleVersion = '0.0.19' - } -) +RequiredModules = @(@{ModuleName = 'JumpCloud.SDK.DirectoryInsights'; ModuleVersion = '0.0.9-Build3905DateTime202008112144 +'; }, + @{ModuleName = 'JumpCloud.SDK.V1'; ModuleVersion = '0.0.15-Build3896DateTime202008102330 +'; }, + @{ModuleName = 'JumpCloud.SDK.V2'; ModuleVersion = '0.0.20-Build3897DateTime202008102343'; }) # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() @@ -103,7 +97,7 @@ FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', 'Update-JCModule', 'Update-JCUsersFromCSV', 'Get-JCEvent', - 'Get-JCEventCount' + 'Get-JCEventCount', 'Get-JCEvent', 'Get-JCEventCount' # 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 = @() From 308518b3a5dbac2d37fbf75704629c28c98126b2 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 12 Aug 2020 15:07:34 -0600 Subject: [PATCH 34/51] Revert "require versions of SDKs" This reverts commit 73c18f4969fd03390855be4d8b27a68861d8dbfe. --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 615186524..d2e2362c0 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -51,11 +51,9 @@ PowerShellVersion = '4.0' # ProcessorArchitecture = '' # Modules that must be imported into the global environment prior to importing this module -RequiredModules = @( - @{ModuleName = 'JumpCloud.SDK.DirectoryInsights'; ModuleVersion = '0.0.9-Build3905DateTime202008112144'; }, - @{ModuleName = 'JumpCloud.SDK.V1'; ModuleVersion = '0.0.15-Build3896DateTime202008102330'; }, - @{ModuleName = 'JumpCloud.SDK.V2'; ModuleVersion = '0.0.20-Build3897DateTime202008102343'; } -) +RequiredModules = @('JumpCloud.SDK.DirectoryInsights', + 'JumpCloud.SDK.V1', + 'JumpCloud.SDK.V2') # Assemblies that must be loaded prior to importing this module # RequiredAssemblies = @() From 44f350798991bb7cc03c8bf70bab48f6422326ea Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 12 Aug 2020 15:09:52 -0600 Subject: [PATCH 35/51] Revert "build by version" This reverts commit bf689430ea4795340a561500cac5eb0f53919b1e. --- PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 b/PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 index eb6c5fd46..7dcee9b8c 100755 --- a/PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 +++ b/PowerShell/Deploy/Functions/Create-ModuleManifest.ps1 @@ -93,13 +93,13 @@ Function New-JCModuleManifest $FunctionParameters.RequiredModules | ForEach-Object { If ([System.String]::IsNullOrEmpty((Get-InstalledModule).Where( { $_.Name -eq $_ }))) { - Write-Host ('Installing: ' + $_.ModuleName) - Install-Module -Name:($_.ModuleName) -RequiredVersion:($_.ModuleVersion) -Force + Write-Host ('Installing: ' + $_) + Install-Module -Name:($_) -Force } If (!(Get-Module -Name:($_))) { - Write-Host ('Importing: ' + $_.ModuleName) - Import-Module -Name:($_.ModuleName) -RequiredVersion:($_.ModuleVersion) -Force + Write-Host ('Importing: ' + $_) + Import-Module -Name:($_) -Force } } } From d56145aacfb0a3830b4095f7f44a51dae08f424a Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Wed, 12 Aug 2020 15:09:56 -0600 Subject: [PATCH 36/51] Revert "jcapitosupport from required modules" This reverts commit f7c76d2120ac0ed2a1a66a8b396c740c41bf657e. --- PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 index 7358e6201..50caa9e0c 100644 --- a/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 +++ b/PowerShell/Deploy/SdkSync/jcapiToSupportSync.ps1 @@ -21,9 +21,9 @@ $Divider = '|#|#|#|#|#|#|#|#|#|#|#|#|#|#|#|' $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 = (Get-Item -Path:($PSScriptRoot)).Parent.Parent.FullName + '/JumpCloud Module' -Import-Module -Name:($RequiredModules.ModuleName) +Import-Module -Name:($RequiredModules) Get-Module -Refresh -ListAvailable -All | Out-Null -$Modules = Get-Module -Name:($RequiredModules.ModuleName | Where-Object { $_ -in $ApprovedFunctions.Keys }) +$Modules = Get-Module -Name:($RequiredModules | Where-Object { $_ -in $ApprovedFunctions.Keys }) If (-not [System.String]::IsNullOrEmpty($Modules)) { ForEach ($Module In $Modules) From eb1518a08ce0bd6af8b2f61434933a949d7f2526 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Wed, 12 Aug 2020 21:15:30 +0000 Subject: [PATCH 37/51] Push to refs/heads/SA-1275_Get-JCSystemInsights_SDK;[skip ci] --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index d2e2362c0..247f5bce0 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -95,7 +95,7 @@ FunctionsToExport = 'Add-JCAssociation', 'Add-JCCommandTarget', 'Set-JCRadiusReplyAttribute', 'Set-JCRadiusServer', 'Set-JCSystem', 'Set-JCSystemUser', 'Set-JCUser', 'Set-JCUserGroupLDAP', 'Update-JCModule', 'Update-JCUsersFromCSV', 'Get-JCEvent', - 'Get-JCEventCount', 'Get-JCEvent', 'Get-JCEventCount' + 'Get-JCEventCount' # 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 = @() From 0341858c10640bf1baf0a84bc407cc84ebec4f50 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 13 Aug 2020 08:11:42 -0600 Subject: [PATCH 38/51] remove invalid example --- .../JumpCloud Module/Docs/Get-JCSystemInsights.md | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md index 4e24b46b6..da2044dab 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md @@ -46,20 +46,6 @@ Return os_version data for systems with specific ids. ### Example 4 ``` -PS C:\> Get-JCSystemInsights -Table:('os_version') -Name:('MacBook-Pro.local_TEST'); -``` - -Return os_version data for a system with a specified name. - -### Example 5 -``` -PS C:\> Get-JCSystemInsights -Table:('os_version') -Name:('MacBook-Pro.local_TEST', 'Holly-Flax-Mac.local_TEST'); -``` - -Return os_version data for systems with specific names. - -### Example 6 -``` PS C:\> Get-JCSystemInsights -Table users -Filter username:eq:jcadmin ``` @@ -146,4 +132,3 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable ## RELATED LINKS [Online Version:](https://github.com/TheJumpCloud/support/wiki/Get-JCSystemInsights) - From 9777ae74e62224706f9fc0969ec1e469826e7208 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 13 Aug 2020 08:36:00 -0600 Subject: [PATCH 39/51] update relese notes --- PowerShell/ModuleBanner.md | 2 ++ PowerShell/ModuleChangelog.md | 36 ++++++++++++++++------------------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/PowerShell/ModuleBanner.md b/PowerShell/ModuleBanner.md index dd1b1b805..e33a7a647 100755 --- a/PowerShell/ModuleBanner.md +++ b/PowerShell/ModuleBanner.md @@ -8,10 +8,12 @@ ``` `Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module. +Get-JCEvent and Get-JCEventCount functions now work with MTP API Keys. ``` #### Banner Old ``` `Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module. +Get-JCEvent and Get-JCEventCount functions now work with MTP API Keys. ``` diff --git a/PowerShell/ModuleChangelog.md b/PowerShell/ModuleChangelog.md index 61362b434..9814329f7 100644 --- a/PowerShell/ModuleChangelog.md +++ b/PowerShell/ModuleChangelog.md @@ -1,32 +1,28 @@ ## 1.18.0 -Release Date: August 12, 2020 +Release Date: August 13, 2020 #### RELEASE NOTES -``` -`Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module. -Feature Enhancements - New SystemInsights tables will be automatically added they become available. - By using tab complete on the `-Filter` parameter and example of how to build the filter will be populated. -Breaking Changes - Table names will no longer contain special characters. - The object returned from the function its properties will not contain special characters. - Table names are singular instead of plural. - Dropping the `-Name` parameter to increase performance. -``` - -#### FEATURES: +* `Get-JCSystemInsights` has been updated to use the `JumpCloud.SDK.V2` powershell module. + * Feature Enhancements + * New SystemInsights tables will be automatically added they become available. + * By using tab complete on the `-Filter` parameter an example of how to build the filter will be populated. + * Breaking Changes + * Table names no longer contain special characters. ex: `_`, `-` + * Returned object properties no longer contain special characters. ex: `_`, `-` + * Table names are singular instead of plural. + * Dropping the `-Name` parameter to increase performance. -Get-JCSystemInsights Tables are independent of the JumpCloud Module, pulled automatically from JumpCloud.SDK.V2 Module -Get-JCEvent and Get-JCEvent MTP API Key functionality -Remove Depreciated SystemInsights Windows Crashes Table. +#### FEATURES -#### IMPROVEMENTS: +Get-JCEvent and Get-JCEventCount functions now work with MTP API Keys. +Get-JCSystemInsights tables are pulled automatically from JumpCloud.SDK.V2 module. +Remove depreciated SystemInsights WindowsCrashes table. -#### BUG FIXES: +#### IMPROVEMENTS -Get-JCEvents and Get-JCEvent functions should now work with MTP API Keys +#### BUG FIXES ## 1.17.5 From 04e3d75a72eb8a4da1aa0ea919797c46d17c38cb Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Thu, 13 Aug 2020 09:18:54 -0600 Subject: [PATCH 40/51] Event Count Tests --- .../Get-JCEventCount.Tests.ps1 | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 index e69de29bb..53c484cd4 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 @@ -0,0 +1,46 @@ +Describe 'Get-JCEvent' -Tag:('JCEvent') { + BeforeAll { + #Requires -Modules JumpCloud + <# ToDo + Service - Not sure how to validate yet (Test that results service value matches parameter value) + #> + # Define parameters for functions + $ParamHash = @{ + "StartTime" = (Get-Date).AddHours(-24).ToUniversalTime(); + "EndTime" = (Get-Date).ToUniversalTime(); + "Service" = "all"; + "Sort" = "DESC" + "SearchTermAnd" = @{ + "event_type" = "user_delete" + } + } + # Create event records for tests + Connect-JCOnline -force | Out-Null + For ($i = 1; $i -le 4; $i++) { + $UserName = 'JCSystemUserTest-{0}' -f $i + Write-Host ("Creating add/delete records for: $UserName") + If (Get-JCUser -username:($UserName)) { + Remove-JCUser -username:($UserName) -Force + } + New-JCUser -username:($UserName) -firstname:($UserName) -lastname:($UserName) -email:($UserName + '@DeleteMe.com') + Remove-JCUser -Username:($UserName) -Force + } + # Allow server time to process + Start-Sleep -Seconds:(10) + # Set EndTime + $ParamHash.EndTime = (Get-Date).ToUniversalTime(); + # Convert times to UTC + $StartTime = [DateTime]$ParamHash.StartTime + $EndTime = [DateTime]$ParamHash.EndTime + } + It 'GetExpanded' { + $eventTest = Get-JCEventCount -Service:($ParamHash.Service) -StartTime:($ParamHash.StartTime) -EndTime:($ParamHash.EndTime) -Sort:($ParamHash.Sort) -SearchTermAnd:($ParamHash.SearchTermAnd) + $eventTest | Should -Not -BeNullOrEmpty + $eventTest | Shoule -BeOfType System.Int64 + } + It 'Get' { + $eventTest = Get-JCEventCount -Body:($ParamHash) + $eventTest | Should -Not -BeNullOrEmpty + $eventTest | Shoule -BeOfType System.Int64 + } +} From b171057032da9130110b58135a50e94df3d3ffbc Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 13 Aug 2020 11:42:39 -0600 Subject: [PATCH 41/51] add include files --- PowerShell/Deploy/BuildNuspecFromPsd1.ps1 | 63 +++++++++++++---------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 b/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 index 64f52f922..d88e6bb7c 100644 --- a/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 +++ b/PowerShell/Deploy/BuildNuspecFromPsd1.ps1 @@ -1,25 +1,9 @@ . ($PSScriptRoot + '/' + 'Get-Config.ps1') - -# Set Variables for New-NuspecFile -$ManifestPath = "$($FilePath_psd1)" -$OutputPath = "$($FolderPath_Module)" -$Psd1 = Import-PowerShellDataFile -Path:($ManifestPath) -$Id = $(Get-Item ($ManifestPath)).BaseName -$Version = $Psd1.ModuleVersion -$Description = $Psd1.Description -$Authors = $Psd1.Author -$Owners = $Psd1.CompanyName -$ReleaseNotes = $Psd1.PrivateData.PSData.ReleaseNotes -$Copyright = $Psd1.Copyright -$Tags = $Psd1.PrivateData.PSData.Tags -$LicenseUrl = $Psd1.PrivateData.PSData.LicenseUri -$ProjectUrl = $Psd1.PrivateData.PSData.ProjectUri -$IconUrl = $Psd1.PrivateData.PSData.IconUri -$Dependencies = $Psd1.RequiredModules - +$nuspecFiles = @{ src = 'en-Us/**;Private/**;Public/**;JumpCloud.psd1;JumpCloud.psm1;LICENSE'; } # Addapted from PowerShell Get # https://github.com/PowerShell/PowerShellGetv2/blob/7de99ee0c38611556e5c583ffaca98bb1922a0d4/src/PowerShellGet/private/functions/New-NuspecFile.ps1 -function New-NuspecFile { +function New-NuspecFile +{ [CmdletBinding()] Param( [Parameter(Mandatory = $true)] @@ -84,7 +68,8 @@ function New-NuspecFile { # warn we're over 4000 characters for standard nuget servers $tagsString = $Tags -Join " " - if ($tagsString.Length -gt 4000) { + if ($tagsString.Length -gt 4000) + { Write-Warning -Message "Tag list exceeded 4000 characters and may not be accepted by some Nuget feeds." } @@ -104,7 +89,8 @@ function New-NuspecFile { if ($ProjectUrl) { $metaDataElementsHash.Add("projectUrl", $ProjectUrl) } if ($IconUrl) { $metaDataElementsHash.Add("iconUrl", $IconUrl) } - foreach ($key in $metaDataElementsHash.Keys) { + foreach ($key in $metaDataElementsHash.Keys) + { $element = $xml.CreateElement($key, $nameSpaceUri) $elementInnerText = $metaDataElementsHash.item($key) $element.InnerText = $elementInnerText @@ -113,10 +99,12 @@ function New-NuspecFile { } - if ($Dependencies) { + if ($Dependencies) + { $dependenciesElement = $xml.CreateElement("dependencies", $nameSpaceUri) - foreach ($dependency in $Dependencies) { + foreach ($dependency in $Dependencies) + { $element = $xml.CreateElement("dependency", $nameSpaceUri) # $element. $element.SetAttribute("id", $dependency) @@ -127,10 +115,12 @@ function New-NuspecFile { $metaDataElement.AppendChild($dependenciesElement) | Out-Null } - if ($Files) { + if ($Files) + { $filesElement = $xml.CreateElement("files", $nameSpaceUri) - foreach ($file in $Files) { + foreach ($file in $Files) + { $element = $xml.CreateElement("file", $nameSpaceUri) $element.SetAttribute("src", $file.src) if ($file.target) { $element.SetAttribute("target", $file.target) } @@ -150,6 +140,23 @@ function New-NuspecFile { Write-Output $nuspecFullName } - - -New-NuspecFile -OutputPath $OutputPath -Id $Id -Version $Version -Description $Description -Authors $Authors -Owners $Owners -ReleaseNotes $ReleaseNotes -Copyright $Copyright -Tags $Tags -LicenseUrl $LicenseUrl -ProjectUrl $ProjectUrl -IconUrl $IconUrl -Dependencies $Dependencies \ No newline at end of file +# Set Variables for New-NuspecFile +$Psd1 = Import-PowerShellDataFile -Path:($FilePath_psd1) +$params = @{ + OutputPath = $FolderPath_Module + Id = $(Get-Item ($FilePath_psd1)).BaseName + Version = $Psd1.ModuleVersion + Authors = $Psd1.Author + Owners = $Psd1.CompanyName + Description = $Psd1.Description + ReleaseNotes = $Psd1.PrivateData.PSData.ReleaseNotes + # RequireLicenseAcceptance = ($requireLicenseAcceptance -eq $true) + Copyright = $Psd1.Copyright + Tags = $Psd1.PrivateData.PSData.Tags + LicenseUrl = $Psd1.PrivateData.PSData.LicenseUri + ProjectUrl = $Psd1.PrivateData.PSData.ProjectUri + IconUrl = $Psd1.PrivateData.PSData.IconUri + Dependencies = $Psd1.RequiredModules + Files = $nuspecFiles +} +New-NuspecFile @params \ No newline at end of file From 2f92f4bb07393c398e8d2bcc7d1c8b21cb30713a Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Thu, 13 Aug 2020 11:49:08 -0600 Subject: [PATCH 42/51] Remove Sort parameter, add Connect-JCOnline --- .../Docs/Get-JCSystemInsights.md | 17 +---------------- .../Public/Systems/Get-JCSystemInsights.ps1 | 7 +------ 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md index da2044dab..7a703cd56 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md @@ -84,23 +84,8 @@ Accept pipeline input: False Accept wildcard characters: False ``` -### -Sort -{{ Fill Sort Description }} - -```yaml -Type: System.String[] -Parameter Sets: (All) -Aliases: - -Required: False -Position: Named -Default value: None -Accept pipeline input: False -Accept wildcard characters: False -``` - ### -SystemId -{{ Fill SystemId Description }} +A comma separated list of System IDs to query against. ```yaml Type: System.String[] diff --git a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 index 4d5bbb2fd..57b59e063 100644 --- a/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 +++ b/PowerShell/JumpCloud Module/Public/Systems/Get-JCSystemInsights.ps1 @@ -104,12 +104,6 @@ Function Get-JCSystemInsights # Use tab complete to see avalible filters. $Filter, - [Parameter()] - [System.String[]] - # The comma separated fields used to sort the collection. - # Default sort is ascending, prefix with `-` to sort descending. - ${Sort}, - [Parameter(DontShow)] [System.Boolean] # Set to $true to return all results. This will overwrite any skip and limit parameter. @@ -117,6 +111,7 @@ Function Get-JCSystemInsights ) Begin { + Connect-JCOnline -force | Out-Null $CommandTemplate = "JumpCloud.SDK.V2\Get-JcSdkSystemInsight{0} @PSBoundParameters" $Results = @() If (-not [System.String]::IsNullOrEmpty($PSBoundParameters.Filter)) From 8223aa2ef46a70e9c222d05eb81a221eefb94f0f Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Thu, 13 Aug 2020 18:00:35 +0000 Subject: [PATCH 43/51] Push to refs/heads/JumpCloudModule_1.18.0;[skip ci] --- .../Docs/Get-JCSystemInsights.md | 3 +- PowerShell/JumpCloud Module/JumpCloud.nuspec | 25 +++++++++++ PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- .../Public/DirectoryInsights/Get-JCEvent.ps1 | 15 +++---- .../DirectoryInsights/Get-JCEventCount.ps1 | 15 +++---- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 42 +------------------ 6 files changed, 41 insertions(+), 61 deletions(-) create mode 100644 PowerShell/JumpCloud Module/JumpCloud.nuspec diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md index 7a703cd56..4a2ac61b1 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCSystemInsights.md @@ -14,8 +14,7 @@ Using this function you can easily gather heightened levels of information from ## SYNTAX ``` -Get-JCSystemInsights -Table [-SystemId ] [[-Filter] ] [-Sort ] - [] +Get-JCSystemInsights -Table [-SystemId ] [[-Filter] ] [] ``` ## DESCRIPTION diff --git a/PowerShell/JumpCloud Module/JumpCloud.nuspec b/PowerShell/JumpCloud Module/JumpCloud.nuspec new file mode 100644 index 000000000..0469e3d87 --- /dev/null +++ b/PowerShell/JumpCloud Module/JumpCloud.nuspec @@ -0,0 +1,25 @@ + + + + JumpCloud + 1.18.0 + PowerShell functions to manage a JumpCloud Directory-as-a-Service + JumpCloud Solutions Architect Team + JumpCloud + https://git.io/jc-pwsh-releasenotes + false + (c) JumpCloud. All rights reserved. + JumpCloud DaaS Jump Cloud Directory + https://github.com/TheJumpCloud/support/blob/master/PowerShell/LICENSE + https://github.com/TheJumpCloud/support/wiki + https://avatars1.githubusercontent.com/u/4927461?s=200&v=4 + + + + + + + + + + \ No newline at end of file diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index 247f5bce0..e09d9bfbc 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 8/12/2020 +# Generated on: 8/13/2020 # @{ diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 index 6b7a7b0ed..f7b9e7884 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEvent.ps1 @@ -54,10 +54,9 @@ BODY : EventQuery is the users' command to search our auth logs [Fields ]: optional list of fields to return from query [Limit ]: Max number of rows to return [SearchAfter ]: Specific query to search after, see x-* response headers for next values - [SearchTermAnd ]: list of event terms. If all terms match the event will be returned by the service. - [(Any) ]: This indicates any property can be added to this object. - [SearchTermOr ]: list of event terms. If any term matches, the event will be returned by the service. + [SearchTermAnd ]: TermConjunction [(Any) ]: This indicates any property can be added to this object. + [SearchTermOr ]: TermConjunction [Sort ]: ASC or DESC order for timestamp .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEvent.md @@ -100,18 +99,16 @@ Function Get-JCEvent [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ISearchTermAnd]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] - # list of event terms. - # If all terms match the event will be returned by the service. + # TermConjunction ${SearchTermAnd}, [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ISearchTermOr]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] - # list of event terms. - # If any term matches, the event will be returned by the service. + # TermConjunction ${SearchTermOr}, [Parameter(ParameterSetName='GetExpanded')] diff --git a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 index b67738c71..e71532424 100644 --- a/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 +++ b/PowerShell/JumpCloud Module/Public/DirectoryInsights/Get-JCEventCount.ps1 @@ -38,10 +38,9 @@ BODY : EventQuery is the users' command to search our auth logs [Fields ]: optional list of fields to return from query [Limit ]: Max number of rows to return [SearchAfter ]: Specific query to search after, see x-* response headers for next values - [SearchTermAnd ]: list of event terms. If all terms match the event will be returned by the service. - [(Any) ]: This indicates any property can be added to this object. - [SearchTermOr ]: list of event terms. If any term matches, the event will be returned by the service. + [SearchTermAnd ]: TermConjunction [(Any) ]: This indicates any property can be added to this object. + [SearchTermOr ]: TermConjunction [Sort ]: ASC or DESC order for timestamp .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/JumpCloud.SDK.DirectoryInsights/docs/exports/Get-JcSdkEventCount.md @@ -84,18 +83,16 @@ Function Get-JCEventCount [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ISearchTermAnd]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] - # list of event terms. - # If all terms match the event will be returned by the service. + # TermConjunction ${SearchTermAnd}, [Parameter(ParameterSetName='GetExpanded')] [JumpCloud.SDK.DirectoryInsights.Category('Body')] - [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ISearchTermOr]))] + [JumpCloud.SDK.DirectoryInsights.Runtime.Info(PossibleTypes=([JumpCloud.SDK.DirectoryInsights.Models.ITermConjunction]))] [System.Collections.Hashtable] - # list of event terms. - # If any term matches, the event will be returned by the service. + # TermConjunction ${SearchTermOr}, [Parameter(ParameterSetName='GetExpanded')] diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 51461ce0a..7da5d5f73 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -6830,22 +6830,10 @@ None - - Sort - - {{ Fill Sort Description }} - - System.String[] - - System.String[] - - - None - SystemId - {{ Fill SystemId Description }} + A comma separated list of System IDs to query against. System.String[] @@ -6881,22 +6869,10 @@ None - - Sort - - {{ Fill Sort Description }} - - System.String[] - - System.String[] - - - None - SystemId - {{ Fill SystemId Description }} + A comma separated list of System IDs to query against. System.String[] @@ -6987,20 +6963,6 @@ -------------------------- Example 4 -------------------------- - PS C:\> Get-JCSystemInsights -Table:('os_version') -Name:('MacBook-Pro.local_TEST'); - - Return os_version data for a system with a specified name. - - - - -------------------------- Example 5 -------------------------- - PS C:\> Get-JCSystemInsights -Table:('os_version') -Name:('MacBook-Pro.local_TEST', 'Holly-Flax-Mac.local_TEST'); - - Return os_version data for systems with specific names. - - - - -------------------------- Example 6 -------------------------- PS C:\> Get-JCSystemInsights -Table users -Filter username:eq:jcadmin Filters the users table for any system with the username jcadmin. From 34b7bb3d329cf2ce733dd3831145bf02bc019410 Mon Sep 17 00:00:00 2001 From: Joe Workman Date: Thu, 13 Aug 2020 12:19:17 -0600 Subject: [PATCH 44/51] Typo in Get-JCEventCount Tests --- .../Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 b/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 index 53c484cd4..6ae5b1f2c 100644 --- a/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 +++ b/PowerShell/JumpCloud Module/Tests/Public/DirectoryInsights/Get-JCEventCount.Tests.ps1 @@ -1,4 +1,4 @@ -Describe 'Get-JCEvent' -Tag:('JCEvent') { +Describe 'Get-JCEventCount' -Tag:('JCEvent') { BeforeAll { #Requires -Modules JumpCloud <# ToDo @@ -36,11 +36,11 @@ Describe 'Get-JCEvent' -Tag:('JCEvent') { It 'GetExpanded' { $eventTest = Get-JCEventCount -Service:($ParamHash.Service) -StartTime:($ParamHash.StartTime) -EndTime:($ParamHash.EndTime) -Sort:($ParamHash.Sort) -SearchTermAnd:($ParamHash.SearchTermAnd) $eventTest | Should -Not -BeNullOrEmpty - $eventTest | Shoule -BeOfType System.Int64 + $eventTest | Should -BeOfType System.Int64 } It 'Get' { $eventTest = Get-JCEventCount -Body:($ParamHash) $eventTest | Should -Not -BeNullOrEmpty - $eventTest | Shoule -BeOfType System.Int64 + $eventTest | Should -BeOfType System.Int64 } } From c437aabaf934726db95b8cce356e0735e3f74fe9 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 13 Aug 2020 14:19:33 -0600 Subject: [PATCH 45/51] maybe this will work --- PowerShell/Deploy/Build-WikiPages.ps1 | 78 +++++++++++++-------------- 1 file changed, 37 insertions(+), 41 deletions(-) diff --git a/PowerShell/Deploy/Build-WikiPages.ps1 b/PowerShell/Deploy/Build-WikiPages.ps1 index 476f1544d..5f7911889 100755 --- a/PowerShell/Deploy/Build-WikiPages.ps1 +++ b/PowerShell/Deploy/Build-WikiPages.ps1 @@ -1,44 +1,40 @@ . ($PSScriptRoot + '/' + 'Get-Config.ps1') ########################################################################### -$CurrentLocation = Get-Location -Set-Location -Path:($StagingDirectory) Invoke-GitClone -Repo:($GitSourceRepoWiki) - -### Add step check out support wiki -# $PathToSupportWikiRepo = '' -# $SupportRepoDocs = $PSScriptRoot + '/Docs' -# $SupportWiki = $PathToSupportWikiRepo + '/support.wiki' -# $Docs = Get-ChildItem -Path:($SupportRepoDocs + '/*.md') -Recurse -# ForEach ($Doc In $Docs) -# { -# $DocName = $Doc.Name -# $DocFullName = $Doc.FullName -# $SupportWikiDocFullName = $SupportWiki + '/' + $DocName -# $DocContent = Get-Content -Path:($DocFullName) -# If (Test-Path -Path:($SupportWikiDocFullName)) -# { -# $SupportWikiDocContent = Get-Content -Path:($SupportWikiDocFullName) -# $Diffs = Compare-Object -ReferenceObject:($DocContent) -DifferenceObject:($SupportWikiDocContent) -# If ($Diffs) -# { -# Write-Warning -Message:('Diffs found in: ' + $DocName) -# # are you sure you want to continue? -# } -# } -# Else -# { -# Write-Warning -Message:('Creating new file: ' + $DocName) -# } -# $NewDocContent = If (($DocContent | Select-Object -First 1) -eq '---') -# { -# $DocContent | Select-Object -Skip:(7) -# } -# Else -# { -# $DocContent -# } -# Set-Content -Path:($SupportWikiDocFullName) -Value:($NewDocContent) -Force -# } -# ### Add step check in changes to support wiki - -Set-Location -Path:($CurrentLocation) \ No newline at end of file +$SupportRepoDocs = "$FolderPath_Module/Docs" +$SupportWiki = "$ScriptRoot/support.wiki" +If (!(Test-Path -Path:($SupportWiki))) { New-Item -Path:($SupportWiki) -ItemType:('Directory') } +Set-Location -Path:($SupportWiki) +$Docs = Get-ChildItem -Path:($SupportRepoDocs + '/*.md') -Recurse +ForEach ($Doc In $Docs) +{ + $DocName = $Doc.Name + $DocFullName = $Doc.FullName + $SupportWikiDocFullName = $SupportWiki + '/' + $DocName + $DocContent = Get-Content -Path:($DocFullName) + If (Test-Path -Path:($SupportWikiDocFullName)) + { + $SupportWikiDocContent = Get-Content -Path:($SupportWikiDocFullName) + $Diffs = Compare-Object -ReferenceObject:($DocContent) -DifferenceObject:($SupportWikiDocContent) + If ($Diffs) + { + Write-Warning -Message:('Diffs found in: ' + $DocName) + # are you sure you want to continue? + } + } + Else + { + Write-Warning -Message:('Creating new file: ' + $DocName) + } + $NewDocContent = If (($DocContent | Select-Object -First 1) -eq '---') + { + $DocContent | Select-Object -Skip:(7) + } + Else + { + $DocContent + } + Set-Content -Path:($SupportWikiDocFullName) -Value:($NewDocContent) -Force +} +# Check in changes to support wiki +Invoke-GitCommit -BranchName:($GitSourceRepoWiki) From 238b5122e91daa7011c331916e875cb1214a637f Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 13 Aug 2020 14:20:16 -0600 Subject: [PATCH 46/51] [skip ci] checkin --- PowerShell/Deploy/Build-WikiPages.ps1 | 1 - 1 file changed, 1 deletion(-) diff --git a/PowerShell/Deploy/Build-WikiPages.ps1 b/PowerShell/Deploy/Build-WikiPages.ps1 index 5f7911889..ffad0969a 100755 --- a/PowerShell/Deploy/Build-WikiPages.ps1 +++ b/PowerShell/Deploy/Build-WikiPages.ps1 @@ -19,7 +19,6 @@ ForEach ($Doc In $Docs) If ($Diffs) { Write-Warning -Message:('Diffs found in: ' + $DocName) - # are you sure you want to continue? } } Else From 0f15b29005d418ba5eda747508bb7a505e11288e Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Thu, 13 Aug 2020 15:49:54 -0600 Subject: [PATCH 47/51] [skip ci] wikiPages update --- PowerShell/Deploy/Build-WikiPages.ps1 | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/PowerShell/Deploy/Build-WikiPages.ps1 b/PowerShell/Deploy/Build-WikiPages.ps1 index ffad0969a..c37edb4a6 100755 --- a/PowerShell/Deploy/Build-WikiPages.ps1 +++ b/PowerShell/Deploy/Build-WikiPages.ps1 @@ -12,11 +12,19 @@ ForEach ($Doc In $Docs) $DocFullName = $Doc.FullName $SupportWikiDocFullName = $SupportWiki + '/' + $DocName $DocContent = Get-Content -Path:($DocFullName) + $NewDocContent = If (($DocContent | Select-Object -First 1) -eq '---') + { + $DocContent | Select-Object -Skip:(7) + } + Else + { + $DocContent + } If (Test-Path -Path:($SupportWikiDocFullName)) { $SupportWikiDocContent = Get-Content -Path:($SupportWikiDocFullName) - $Diffs = Compare-Object -ReferenceObject:($DocContent) -DifferenceObject:($SupportWikiDocContent) - If ($Diffs) + $Diffs = Compare-Object -ReferenceObject:($NewDocContent) -DifferenceObject:($SupportWikiDocContent) + If (-not [string]::IsNullOrEmpty($Diffs)) { Write-Warning -Message:('Diffs found in: ' + $DocName) } @@ -25,15 +33,7 @@ ForEach ($Doc In $Docs) { Write-Warning -Message:('Creating new file: ' + $DocName) } - $NewDocContent = If (($DocContent | Select-Object -First 1) -eq '---') - { - $DocContent | Select-Object -Skip:(7) - } - Else - { - $DocContent - } Set-Content -Path:($SupportWikiDocFullName) -Value:($NewDocContent) -Force } # Check in changes to support wiki -Invoke-GitCommit -BranchName:($GitSourceRepoWiki) +# Invoke-GitCommit -BranchName:($GitSourceRepoWiki) \ No newline at end of file From 01212bdcfb4897290f42512fd566fb8a24f50a82 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Thu, 13 Aug 2020 15:50:35 -0600 Subject: [PATCH 48/51] [skip ci] invoke-gitcommit on build-WikiPages --- PowerShell/Deploy/Build-WikiPages.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/Deploy/Build-WikiPages.ps1 b/PowerShell/Deploy/Build-WikiPages.ps1 index c37edb4a6..d3aa4dac7 100755 --- a/PowerShell/Deploy/Build-WikiPages.ps1 +++ b/PowerShell/Deploy/Build-WikiPages.ps1 @@ -36,4 +36,4 @@ ForEach ($Doc In $Docs) Set-Content -Path:($SupportWikiDocFullName) -Value:($NewDocContent) -Force } # Check in changes to support wiki -# Invoke-GitCommit -BranchName:($GitSourceRepoWiki) \ No newline at end of file +Invoke-GitCommit -BranchName:($GitSourceRepoWiki) \ No newline at end of file From d5595bfe22e5614ac1be7c5b2a8df3b0c7a7e6b8 Mon Sep 17 00:00:00 2001 From: epanipinto-jc <45767377+epanipinto-jc@users.noreply.github.com> Date: Thu, 13 Aug 2020 16:59:02 -0600 Subject: [PATCH 49/51] Remove old refs to systeminsights --- .../Get-JCCommonParameters.ps1 | 32 - .../Private/NestedFunctions/Get-JCObject.ps1 | 45 +- .../Private/NestedFunctions/JCTypes.json | 1042 ----------------- 3 files changed, 3 insertions(+), 1116 deletions(-) diff --git a/PowerShell/JumpCloud Module/Private/DynamicParameters/Get-JCCommonParameters.ps1 b/PowerShell/JumpCloud Module/Private/DynamicParameters/Get-JCCommonParameters.ps1 index 0ae42ed90..7e6784b1a 100644 --- a/PowerShell/JumpCloud Module/Private/DynamicParameters/Get-JCCommonParameters.ps1 +++ b/PowerShell/JumpCloud Module/Private/DynamicParameters/Get-JCCommonParameters.ps1 @@ -75,37 +75,6 @@ Function Get-JCCommonParameters 'HelpMessage' = 'An array of the fields/properties/columns you want to return from the search.'; 'Position' = 95; } - $Param_Filter = @{ - 'Name' = 'Filter'; - 'Type' = [System.String]; - 'ValueFromPipelineByPropertyName' = $true; - 'ValidateNotNullOrEmpty' = $true; - 'ParameterSets' = @('ById', 'ByName', 'ByValue', '__AllParameterSets'); - 'HelpMessage' = 'Filters to narrow down search.'; - 'ValidateScript' = { - $FilterPattern = [regex]'.*?:.*?:.*?' - If ($_ -notmatch $FilterPattern) - { - Throw ('Invalid filter "' + $_ + '". Filter must match pattern: {PropertyName}:{Operator}:{Value} (' + $FilterPattern + ')') - } - Else - { - $FilterParts = $_ -split ':' - $FilterProperties = ((($JCType.ByName, $JCType.ById) + $JCType.SystemInsights.ByName + $JCType.SystemInsights.ById) | Select-Object -Unique) - $FilterOperators = $JCType.FilterOperators + $JCType.SystemInsights.FilterOperators | Select-Object -Unique - If ($FilterParts[0] -notin $FilterProperties) - { - Throw ('Invalid filter property provided "' + $FilterParts[0] + '". Accepted filter properties: "' + ($FilterProperties -join ', ') + '"') - } - If ($FilterParts[1] -notin $FilterOperators) - { - Throw ('Invalid filter operator provided "' + $FilterParts[1] + '". Accepted filter operators: "' + ($FilterOperators -join ', ') + '"') - } - $true - } - }; - 'Position' = 96; - } $Param_Limit = @{ 'Name' = 'Limit'; 'Type' = [System.Int32]; @@ -180,7 +149,6 @@ Function Get-JCCommonParameters If ($Action -eq 'get') { $Param_Fields.ParameterSets += 'Default' - $Param_Filter.ParameterSets += 'Default' $Param_Limit.ParameterSets += 'Default' $Param_Skip.ParameterSets += 'Default' $Param_Paginate.ParameterSets += 'Default' diff --git a/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCObject.ps1 b/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCObject.ps1 index d06729b91..a991de9c0 100755 --- a/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCObject.ps1 +++ b/PowerShell/JumpCloud Module/Private/NestedFunctions/Get-JCObject.ps1 @@ -16,10 +16,6 @@ Function Get-JCObject { Get-JCCommonParameters -Force:($true) -Action:($Action); } - If ('SystemInsights' -in $JCType.PSObject.Properties.Name -or (Get-PSCallStack).Command -like '*MarkdownHelp') - { - New-DynamicParameter -Name:('Table') -Type:([System.String]) -ValueFromPipelineByPropertyName -ValidateNotNullOrEmpty -ValidateSet:($JCType.SystemInsights.Table) -HelpMessage:('The SystemInsights table to query against.') -RuntimeParameterDictionary:($RuntimeParameterDictionary) | Out-Null - } New-DynamicParameter -Name:('ReturnHashTable') -Type:([switch]) -ValueFromPipelineByPropertyName -RuntimeParameterDictionary:($RuntimeParameterDictionary) -DefaultValue:($false) | Out-Null New-DynamicParameter -Name:('ReturnCount') -Type:([switch]) -ValueFromPipelineByPropertyName -DefaultValue:($false) -RuntimeParameterDictionary:($RuntimeParameterDictionary) | Out-Null Return $RuntimeParameterDictionary @@ -38,15 +34,6 @@ Function Get-JCObject { If ($JCType) { - # Set the location base location in the json config and elect the specific system insights table - $JCType = If ($PsBoundParameters.Table -and $PSCmdlet.ParameterSetName -ne 'ByName') - { - $JCType.SystemInsights | Where-Object { $_.Table -eq $PsBoundParameters.Table } - } - Else - { - $JCType - } $UrlObject = @() # If searching ByValue add filters to query string and body. If ($PSCmdlet.ParameterSetName -eq 'ById') @@ -89,18 +76,6 @@ Function Get-JCObject { $JCType.Url.List } - # Populate query string filter - If ($Filter) - { - $QueryString = If ($UrlOut -like '*filter=*') - { - ',' + $Filter - } - Else - { - '?filter=' + $Filter - } - } # Build final body and url $UrlObject += [PSCustomObject]@{ 'Type' = $Type; @@ -241,7 +216,7 @@ Function Get-JCObject # Validate results If ($Result -and $Result.PSObject.Properties.name -notcontains 'NoContent') { - If ($SearchBy -and ($Result | Measure-Object).Count -gt 1 -and $UrlFull -notlike '*SystemInsights*') + If ($SearchBy -and ($Result | Measure-Object).Count -gt 1) { Write-Warning -Message:('Found "' + [string]($Result | Measure-Object).Count + '" "' + $JCType.TypeName.TypeNamePlural + '" with the "' + $SearchBy.Replace('By', '').ToLower() + '" of "' + $SearchByValueItem + '"') } @@ -249,25 +224,11 @@ Function Get-JCObject } ElseIf ($SearchByValueItem) { - If ($PsBoundParameters.Table) - { - Write-Warning ('No SystemInsights data found in "' + $PsBoundParameters.Table + '" where "' + $SearchBy.Replace('By', '').ToLower() + '" is "' + $SearchByValueItem + '".') - } - Else - { - Write-Warning ('A "' + $JCType.TypeName.TypeNameSingular + '" called "' + $SearchByValueItem + '" does not exist. Note the search is case sensitive.') - } + Write-Warning ('A "' + $JCType.TypeName.TypeNameSingular + '" called "' + $SearchByValueItem + '" does not exist. Note the search is case sensitive.') } Else { - If ($PsBoundParameters.Table) - { - Write-Warning ('No SystemInsights data found in "' + $PsBoundParameters.Table + '".') - } - Else - { - Write-Warning ('The search value is blank or no "' + $JCType.TypeName.TypeNamePlural + '" have been setup in your org. SearchValue:"' + $SearchByValueItem + '"') - } + Write-Warning ('The search value is blank or no "' + $JCType.TypeName.TypeNamePlural + '" have been setup in your org. SearchValue:"' + $SearchByValueItem + '"') } } # Re-lookup object by id diff --git a/PowerShell/JumpCloud Module/Private/NestedFunctions/JCTypes.json b/PowerShell/JumpCloud Module/Private/NestedFunctions/JCTypes.json index 105a9f5d9..e4eb44a75 100755 --- a/PowerShell/JumpCloud Module/Private/NestedFunctions/JCTypes.json +++ b/PowerShell/JumpCloud Module/Private/NestedFunctions/JCTypes.json @@ -335,1048 +335,6 @@ "TargetExcludedSingular": "user_group", "TargetExcludedPlural": "usergroups" } - ], - "SystemInsights": [ - { - "Table": "battery", - "Url": { - "List": "/api/v2/systeminsights/battery", - "Item": "/api/v2/systeminsights/battery?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "health", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "managed_policies", - "Url": { - "List": "/api/v2/systeminsights/managed_policies", - "Item": "/api/v2/systeminsights/managed_policies?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "domain", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "sip_config", - "Url": { - "List": "/api/v2/systeminsights/sip_config", - "Item": "/api/v2/systeminsights/sip_config?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "enabled", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "alf", - "Url": { - "List": "/api/v2/systeminsights/alf", - "Item": "/api/v2/systeminsights/alf?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "global_state", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "crashes", - "Url": { - "List": "/api/v2/systeminsights/crashes", - "Item": "/api/v2/systeminsights/crashes?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "identifier", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "usb_devices", - "Url": { - "List": "/api/v2/systeminsights/usb_devices", - "Item": "/api/v2/systeminsights/usb_devices?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "model", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "ie_extensions", - "Url": { - "List": "/api/v2/systeminsights/ie_extensions", - "Item": "/api/v2/systeminsights/ie_extensions?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "launchd", - "Url": { - "List": "/api/v2/systeminsights/launchd", - "Item": "/api/v2/systeminsights/launchd?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "shared_folders", - "Url": { - "List": "/api/v2/systeminsights/shared_folders", - "Item": "/api/v2/systeminsights/shared_folders?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "shared_resources", - "Url": { - "List": "/api/v2/systeminsights/shared_resources", - "Item": "/api/v2/systeminsights/shared_resources?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "type", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "user_ssh_keys", - "Url": { - "List": "/api/v2/systeminsights/user_ssh_keys", - "Item": "/api/v2/systeminsights/user_ssh_keys?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "encrypted", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "logged_in_users", - "Url": { - "List": "/api/v2/systeminsights/logged_in_users", - "Item": "/api/v2/systeminsights/logged_in_users?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "username", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "shadow", - "Url": { - "List": "/api/v2/systeminsights/shadow", - "Item": "/api/v2/systeminsights/shadow?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "username", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "sharing_preferences", - "Url": { - "List": "/api/v2/systeminsights/sharing_preferences", - "Item": "/api/v2/systeminsights/sharing_preferences?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "Name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "user_groups", - "Url": { - "List": "/api/v2/systeminsights/user_groups", - "Item": "/api/v2/systeminsights/user_groups?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "Name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "kernel_info", - "Url": { - "List": "/api/v2/systeminsights/kernel_info", - "Item": "/api/v2/systeminsights/kernel_info?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "version", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "system_controls", - "Url": { - "List": "/api/v2/systeminsights/system_controls", - "Item": "/api/v2/systeminsights/system_controls?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "uptime", - "Url": { - "List": "/api/v2/systeminsights/uptime", - "Item": "/api/v2/systeminsights/uptime?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "days", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "etc_hosts", - "Url": { - "List": "/api/v2/systeminsights/etc_hosts", - "Item": "/api/v2/systeminsights/etc_hosts?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "address", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "logical_drives", - "Url": { - "List": "/api/v2/systeminsights/logical_drives", - "Item": "/api/v2/systeminsights/logical_drives?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "device_id", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "disk_info", - "Url": { - "List": "/api/v2/systeminsights/disk_info", - "Item": "/api/v2/systeminsights/disk_info?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "disk_index", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "bitlocker_info", - "Url": { - "List": "/api/v2/systeminsights/bitlocker_info", - "Item": "/api/v2/systeminsights/bitlocker_info?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "protection_status", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "patches", - "Url": { - "List": "/api/v2/systeminsights/patches", - "Item": "/api/v2/systeminsights/patches?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "hotfix_id", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "programs", - "Url": { - "List": "/api/v2/systeminsights/programs", - "Item": "/api/v2/systeminsights/programs?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "apps", - "Url": { - "List": "/api/v2/systeminsights/apps", - "Item": "/api/v2/systeminsights/apps?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "bundle_name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "browser_plugins", - "Url": { - "List": "/api/v2/systeminsights/browser_plugins", - "Item": "/api/v2/systeminsights/browser_plugins?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "chrome_extensions", - "Url": { - "List": "/api/v2/systeminsights/chrome_extensions", - "Item": "/api/v2/systeminsights/chrome_extensions?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "disk_encryption", - "Url": { - "List": "/api/v2/systeminsights/disk_encryption", - "Item": "/api/v2/systeminsights/disk_encryption?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "encryption_status", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "firefox_addons", - "Url": { - "List": "/api/v2/systeminsights/firefox_addons", - "Item": "/api/v2/systeminsights/firefox_addons?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "groups", - "Url": { - "List": "/api/v2/systeminsights/groups", - "Item": "/api/v2/systeminsights/groups?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "groupname", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "interface_addresses", - "Url": { - "List": "/api/v2/systeminsights/interface_addresses", - "Item": "/api/v2/systeminsights/interface_addresses?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "address", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "mounts", - "Url": { - "List": "/api/v2/systeminsights/mounts", - "Item": "/api/v2/systeminsights/mounts?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "path", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "os_version", - "Url": { - "List": "/api/v2/systeminsights/os_version", - "Item": "/api/v2/systeminsights/os_version?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "version", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "safari_extensions", - "Url": { - "List": "/api/v2/systeminsights/safari_extensions", - "Item": "/api/v2/systeminsights/safari_extensions?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "system_info", - "Url": { - "List": "/api/v2/systeminsights/system_info", - "Item": "/api/v2/systeminsights/system_info?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "cpu_subtype", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "users", - "Url": { - "List": "/api/v2/systeminsights/users", - "Item": "/api/v2/systeminsights/users?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "username", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "certificates", - "Url": { - "List": "/api/v2/systeminsights/certificates", - "Item": "/api/v2/systeminsights/certificates?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "common_name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "cups_destinations", - "Url": { - "List": "/api/v2/systeminsights/cups_destinations", - "Item": "/api/v2/systeminsights/cups_destinations?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "interface_details", - "Url": { - "List": "/api/v2/systeminsights/interface_details", - "Item": "/api/v2/systeminsights/interface_details?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "interface", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "python_packages", - "Url": { - "List": "/api/v2/systeminsights/python_packages", - "Item": "/api/v2/systeminsights/python_packages?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "scheduled_tasks", - "Url": { - "List": "/api/v2/systeminsights/scheduled_tasks", - "Item": "/api/v2/systeminsights/scheduled_tasks?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "enabled", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "services", - "Url": { - "List": "/api/v2/systeminsights/services", - "Item": "/api/v2/systeminsights/services?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "startup_items", - "Url": { - "List": "/api/v2/systeminsights/startup_items", - "Item": "/api/v2/systeminsights/startup_items?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "authorized_keys", - "Url": { - "List": "/api/v2/systeminsights/authorized_keys", - "Item": "/api/v2/systeminsights/authorized_keys?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "uid", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "appcompat_shims", - "Url": { - "List": "/api/v2/systeminsights/appcompat_shims", - "Item": "/api/v2/systeminsights/appcompat_shims?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "path", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "dns_resolvers", - "Url": { - "List": "/api/v2/systeminsights/dns_resolvers", - "Item": "/api/v2/systeminsights/dns_resolvers?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "type", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "wifi_networks", - "Url": { - "List": "/api/v2/systeminsights/wifi_networks", - "Item": "/api/v2/systeminsights/wifi_networks?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "security_type", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "wifi_status", - "Url": { - "List": "/api/v2/systeminsights/wifi_status", - "Item": "/api/v2/systeminsights/wifi_status?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "security_type", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "connectivity", - "Url": { - "List": "/api/v2/systeminsights/connectivity", - "Item": "/api/v2/systeminsights/connectivity?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "Name", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "windows_security_products", - "Url": { - "List": "/api/v2/systeminsights/windows_security_products", - "Item": "/api/v2/systeminsights/windows_security_products?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "state", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "alf_exceptions", - "Url": { - "List": "/api/v2/systeminsights/alf_exceptions", - "Item": "/api/v2/systeminsights/alf_exceptions?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "state", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - }, - { - "Table": "alf_explicit_auths", - "Url": { - "List": "/api/v2/systeminsights/alf_explicit_auths", - "Item": "/api/v2/systeminsights/alf_explicit_auths?filter=system_id:eq:{system_id}", - "Variables": [ - "{system_id}" - ] - }, - "Method": "GET", - "ById": "system_id", - "ByName": "process", - "Paginate": true, - "SupportRegexFilter": false, - "Limit": 100, - "Skip": 0, - "FilterOperators": [ - "eq" - ] - } ] }, { From 0848ef5ab8c09ffd48e4b6d503e111be6b4538e0 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Thu, 13 Aug 2020 23:06:48 +0000 Subject: [PATCH 50/51] Push to refs/heads/JumpCloudModule_1.18.0;[skip ci] --- .../Docs/Get-JCAssociation.md | 39 ++++------ .../Docs/Get-JCRadiusServer.md | 31 +++----- .../JumpCloud Module/en-Us/JumpCloud-help.xml | 72 ------------------- 3 files changed, 20 insertions(+), 122 deletions(-) diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCAssociation.md b/PowerShell/JumpCloud Module/Docs/Get-JCAssociation.md index 4cc1e59f6..3b5136b7c 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCAssociation.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCAssociation.md @@ -14,30 +14,30 @@ The function Get-JCAssociation can be used to query an object's associations and ### ById (Default) ``` -Get-JCAssociation [-Type] [-Force] [-Id] [[-Fields] ] [[-Filter] ] - [[-Limit] ] [[-Skip] ] [[-Paginate] ] [[-TargetType] ] [-Direct] [-Indirect] - [-IncludeInfo] [-IncludeNames] [-IncludeVisualPath] [] +Get-JCAssociation [-Type] [-Force] [-Id] [[-Fields] ] [[-Limit] ] + [[-Skip] ] [[-Paginate] ] [[-TargetType] ] [-Direct] [-Indirect] [-IncludeInfo] + [-IncludeNames] [-IncludeVisualPath] [] ``` ### ByName ``` -Get-JCAssociation [-Type] [-Force] [-Name] [[-Fields] ] [[-Filter] ] - [[-Limit] ] [[-Skip] ] [[-Paginate] ] [[-TargetType] ] [-Direct] [-Indirect] - [-IncludeInfo] [-IncludeNames] [-IncludeVisualPath] [] +Get-JCAssociation [-Type] [-Force] [-Name] [[-Fields] ] [[-Limit] ] + [[-Skip] ] [[-Paginate] ] [[-TargetType] ] [-Direct] [-Indirect] [-IncludeInfo] + [-IncludeNames] [-IncludeVisualPath] [] ``` ### ByValue ``` -Get-JCAssociation [-Type] [-Force] [[-Fields] ] [[-Filter] ] [[-Limit] ] - [[-Skip] ] [[-Paginate] ] [[-TargetType] ] [-Direct] [-Indirect] [-IncludeInfo] - [-IncludeNames] [-IncludeVisualPath] [] +Get-JCAssociation [-Type] [-Force] [[-Fields] ] [[-Limit] ] [[-Skip] ] + [[-Paginate] ] [[-TargetType] ] [-Direct] [-Indirect] [-IncludeInfo] [-IncludeNames] + [-IncludeVisualPath] [] ``` ### Default ``` -Get-JCAssociation [-Type] [-Force] [[-Fields] ] [[-Filter] ] [[-Limit] ] - [[-Skip] ] [[-Paginate] ] [[-TargetType] ] [-Direct] [-Indirect] [-IncludeInfo] - [-IncludeNames] [-IncludeVisualPath] [] +Get-JCAssociation [-Type] [-Force] [[-Fields] ] [[-Limit] ] [[-Skip] ] + [[-Paginate] ] [[-TargetType] ] [-Direct] [-Indirect] [-IncludeInfo] [-IncludeNames] + [-IncludeVisualPath] [] ``` ## DESCRIPTION @@ -112,21 +112,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Filter -Filters to narrow down search. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 96 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -Force Bypass user prompts and dynamic ValidateSet. diff --git a/PowerShell/JumpCloud Module/Docs/Get-JCRadiusServer.md b/PowerShell/JumpCloud Module/Docs/Get-JCRadiusServer.md index 93aad7a99..02ab31e84 100644 --- a/PowerShell/JumpCloud Module/Docs/Get-JCRadiusServer.md +++ b/PowerShell/JumpCloud Module/Docs/Get-JCRadiusServer.md @@ -14,26 +14,26 @@ Return JumpCloud radius server information. ### Default (Default) ``` -Get-JCRadiusServer [-Force] [[-Fields] ] [[-Filter] ] [[-Limit] ] [[-Skip] ] - [[-Paginate] ] [] +Get-JCRadiusServer [-Force] [[-Fields] ] [[-Limit] ] [[-Skip] ] [[-Paginate] ] + [] ``` ### ById ``` -Get-JCRadiusServer [-Force] [-Id] [[-Fields] ] [[-Filter] ] [[-Limit] ] - [[-Skip] ] [[-Paginate] ] [] +Get-JCRadiusServer [-Force] [-Id] [[-Fields] ] [[-Limit] ] [[-Skip] ] + [[-Paginate] ] [] ``` ### ByName ``` -Get-JCRadiusServer [-Force] [-Name] [[-Fields] ] [[-Filter] ] [[-Limit] ] - [[-Skip] ] [[-Paginate] ] [] +Get-JCRadiusServer [-Force] [-Name] [[-Fields] ] [[-Limit] ] [[-Skip] ] + [[-Paginate] ] [] ``` ### ByValue ``` -Get-JCRadiusServer [-Force] [[-Fields] ] [[-Filter] ] [[-Limit] ] [[-Skip] ] - [[-Paginate] ] [] +Get-JCRadiusServer [-Force] [[-Fields] ] [[-Limit] ] [[-Skip] ] [[-Paginate] ] + [] ``` ## DESCRIPTION @@ -79,21 +79,6 @@ Accept pipeline input: True (ByPropertyName) Accept wildcard characters: False ``` -### -Filter -Filters to narrow down search. - -```yaml -Type: System.String -Parameter Sets: (All) -Aliases: - -Required: False -Position: 96 -Default value: None -Accept pipeline input: True (ByPropertyName) -Accept wildcard characters: False -``` - ### -Force Bypass user prompts and dynamic ValidateSet. diff --git a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml index 7da5d5f73..7f49f6185 100644 --- a/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml +++ b/PowerShell/JumpCloud Module/en-Us/JumpCloud-help.xml @@ -2397,18 +2397,6 @@ None - - Filter - - Filters to narrow down search. - - System.String - - System.String - - - None - Limit @@ -2592,18 +2580,6 @@ None - - Filter - - Filters to narrow down search. - - System.String - - System.String - - - None - Limit @@ -2682,18 +2658,6 @@ None - - Filter - - Filters to narrow down search. - - System.String - - System.String - - - None - Force @@ -5527,18 +5491,6 @@ None - - Filter - - Filters to narrow down search. - - System.String - - System.String - - - None - Limit @@ -5617,18 +5569,6 @@ None - - Filter - - Filters to narrow down search. - - System.String - - System.String - - - None - Limit @@ -5695,18 +5635,6 @@ None - - Filter - - Filters to narrow down search. - - System.String - - System.String - - - None - Force From b7e5bb1653c930a9a83adeb2927ff575df050df8 Mon Sep 17 00:00:00 2001 From: AzurePipelines Date: Fri, 14 Aug 2020 02:58:49 +0000 Subject: [PATCH 51/51] Push to refs/heads/JumpCloudModule_1.18.0;[skip ci] --- PowerShell/JumpCloud Module/JumpCloud.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerShell/JumpCloud Module/JumpCloud.psd1 b/PowerShell/JumpCloud Module/JumpCloud.psd1 index e09d9bfbc..ff0ca8339 100755 --- a/PowerShell/JumpCloud Module/JumpCloud.psd1 +++ b/PowerShell/JumpCloud Module/JumpCloud.psd1 @@ -3,7 +3,7 @@ # # Generated by: JumpCloud Solutions Architect Team # -# Generated on: 8/13/2020 +# Generated on: 8/14/2020 # @{