Skip to content

Commit

Permalink
Expand arrays returned by Get-TenableGroup* (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
RobFaie authored Aug 20, 2020
1 parent f541af2 commit 59b4be5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion functions/Get-Group.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,12 @@ function Get-Group {
)

$path = '/groups'
Invoke-Method -Context $Context -Path $path -Verbose:$VerbosePreference
$result = Invoke-Method -Context $Context -Path $path -Verbose:$VerbosePreference
if ($result) {
if ($result | Get-Member -Name groups) {
$result | ForEach-Object groups
} else {
$result
}
}
}
9 changes: 8 additions & 1 deletion functions/Get-GroupMember.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,12 @@ function Get-GroupMember {

$path = "/groups/$GroupId/users"

Invoke-Method -Context $Context -Path $path -Verbose:$VerbosePreference
$result = Invoke-Method -Context $Context -Path $path -Verbose:$VerbosePreference
if ($result) {
if ($result | Get-Member -Name users) {
$result | ForEach-Object users
} else {
$result
}
}
}

0 comments on commit 59b4be5

Please sign in to comment.