AtlassianPS / ConfluencePS

Confluence REST API (including Cloud) via PowerShell
https://AtlassianPS.org/module/ConfluencePS
MIT License
152 stars 41 forks source link

Get-ChildPage -Recurse minimum version #76

Open brianbunke opened 7 years ago

brianbunke commented 7 years ago

Expected Behavior

Specifying -Recurse on Get-ConfluenceChildPage should return all child pages, regardless of nesting level.

Current Behavior

-Recurse returns an error when used.

Possible Solution

Fix or remove for v2.0. Totally fine if we add it in a future version.

Steps to Reproduce (for bugs)

PS C:\> Get-ConfluenceChildPage -PageID 123456 -Recurse
WARNING: Confluence returned HTTP error 501 - NotImplemented
Invoke-Method : 
At [...]\ConfluencePS\Public\Get-ChildPage.ps1:116 char:9
+         Invoke-Method @iwParameters
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-Method

Your Environment

ConfluencePS develop branch, a689311e61c12de9de5ba5d4de9db3b44be9c58f

lipkau commented 7 years ago

Ha!

I think this is the first future we implemented that is confluence version specific: image

brianbunke commented 7 years ago

Heh, this works on my cloud instance. Someone needs to update his on-prem install 🙈

lipkau commented 7 years ago

but still: that should make us define how to handle such a thing... what should be the output when a feature is not supported by the confluence version it is being run against?

brianbunke commented 7 years ago

We can catch a 501 error in Invoke-Method, and then provide a more helpful error message ("UPGRADE YOUR 💩"), but that's still a generic fix.

Otherwise, we would have to add a minimum supported version (within commands, to invidividual parameters...bleh) when we come across these scenarios. That seems lame, but maybe it'll rarely happen, and not be that big of a deal?

lipkau commented 7 years ago

I am not sure 501 will do, I am pretty sure some apis that will come in future don't return that in the current version. I could test that with POST /user to create a new user