Hello dear community,
I am trying to auto generate a new confluence child Page using Powershell and OAuth token
For this I am using the commands below but always receive the error
WARNING: Confluence returned HTTP error 401 - Unauthorized
Invoke-Method : An unknown error ocurred.
At C:\Program Files\WindowsPowerShell\Modules\ConfluencePS\2.5.0\ConfluencePS.psm1:249 char:14
+ (Invoke-Method @iwParameters).value
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidResult: (:String) [Invoke-Method], ArgumentException
+ FullyQualifiedErrorId : InvalidResponse.Status401,Invoke-Method
WARNING: Failed to create child page. Check whether you are trying to upload an existing alert version, then try again.
The approach I am using is the following
$SecurePassword = ConvertTo-SecureString $ConfluenceOuthToken -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ($ConfluenceUserID, $SecurePassword)
$ChildPageName = 'Test' + $AlertVersion + '- Alert List'
$ScriptPath = $PSScriptRoot.Substring(0, ($PSScriptRoot.Length - 9)) + 'Alerting/Alerts/'
Set-ConfluenceInfo -BaseURi 'https://confluence.xxx.com/display/CSA' -Credential $Cred -EA 0 -WA 0
New-ConfluencePage -Title $ChildPageName -ParentID 162xxx -Body $PageBody -EA 0 -WA 0