Open brianbunke opened 7 years ago
This parameter is auto-generated with
[CmdletBinding(SupportsPaging = $true)]
The TotalCount is defined in this line:
$PSCmdlet.PagingParameters.NewTotalCount($response.size, $Accuracy)
$accuracy
is a float between 1 and 0.
1 means the number is 100% accurate
0 means the number is 0% accurate
As we don't get any indication of the REST how many results will be returned, 0 was the most appropriated at the time.
We can count the results per page and send it along with the self-invocation in order to know how many results were returned. And only display the Total count at the end of the result set.
Would that be ok for you?
...I did not realize SupportsPaging
auto-generated parameters.
I like that suggestion. As a user, I don't expect count to come before the results anyway.
[int]$count = 0
parameter to Invoke-Method
$count + $result.count
https://github.com/AtlassianPS/ConfluencePS/blob/develop/ConfluencePS/Private/Invoke-Method.ps1#L195$PSCmdlet.PagingParameters.NewTotalCount($count, $Accuracy)
) to the end} elseif ($count -gt 0) {
-IncludeTotalCount
on the 2.0Get-*
commands seems to always return "Unknown total count" for me.Expected Behavior
-IncludeTotalCount
does somethingCurrent Behavior
Regardless of whether PageSize is higher or lower than the actual total count of objects, I can't get any number to return. Instead, I always see "Unknown total count".
Possible Solution
I'd be fine if this parameter didn't exist. If you need to count, you can still
(Get-ConfluenceSpace).Count
. Happy to hear otherwise if I'm missing something, though.Steps to Reproduce (for bugs)
Your Environment
ConfluencePS
develop
branch, futurev2.0