Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set-ConfluenceInfo does not persist when called in a function #199

Open
mcx808 opened this issue Jan 28, 2022 · 2 comments
Open

Set-ConfluenceInfo does not persist when called in a function #199

mcx808 opened this issue Jan 28, 2022 · 2 comments

Comments

@mcx808
Copy link

mcx808 commented Jan 28, 2022

I created a draft powershell script that called the following in the begin{} block:
Set-ConfluenceInfo -BaseURi "$baseUri" -Credential $ConfluenceCredential
Then in the process{} block I would use Get-ConfluencePage and Set-ConfluencePage with the following parameters:
Get-ConfluencePage -SpaceKey $SpaceKey | Where-Object {$_.Title -eq $PageTitle}

Once I was happy with the script I created a function around it and added to a module but it would always ask me for the ApiUrl when Get-ConfluencePage was called.

I temporary workaround was to add the following when wrapping as a function

$PSDefaultParameterValues['Disabled'] = $true
$apiUri = $baseUri + '/rest/api'
Get-ConfluencePage -SpaceKey $SpaceKey -ApiUri $apiUri -Credential $ConfluenceCredential| Where-Object {$_.Title -eq $PageTitle}

Is there a known issue for why the behaviour is different and incompatible when called as a function instead of script?

@cwanized
Copy link

I got the same behavior.

For me, version 2.5.0 is working fine. I guess I stick with version right now...

any word from the developers?

@mcx808
Copy link
Author

mcx808 commented Sep 30, 2024

I got the same behavior.

For me, version 2.5.0 is working fine. I guess I stick with version right now...

any word from the developers?

Nope, not a peep since I opened the issue. Considering the last commit was 3 years ago I'm guessing the project is abandoned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants