diff --git a/JiraPS/Public/Get-JiraUser.ps1 b/JiraPS/Public/Get-JiraUser.ps1 index 984f9cd2..cc2bdc1f 100644 --- a/JiraPS/Public/Get-JiraUser.ps1 +++ b/JiraPS/Public/Get-JiraUser.ps1 @@ -73,16 +73,18 @@ function Get-JiraUser { Credential = $Credential } Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" - if ($result = Invoke-JiraMethod @parameter) { - $parameter = @{ - URI = "{0}&expand=groups" -f $result.self - Method = "GET" - Credential = $Credential + if ($users = Invoke-JiraMethod @parameter) { + foreach ($item in $users) { + $parameter = @{ + URI = "{0}&expand=groups" -f $item.self + Method = "GET" + Credential = $Credential + } + Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" + $result = Invoke-JiraMethod @parameter + + Write-Output (ConvertTo-JiraUser -InputObject $result) } - Write-Debug "[$($MyInvocation.MyCommand.Name)] Invoking JiraMethod with `$parameter" - $result = Invoke-JiraMethod @parameter - - Write-Output (ConvertTo-JiraUser -InputObject $result) } else { $errorMessage = @{