<# .SYNOPSIS Loescht die Test-Seite "TEST Umlaut-Pruefung" (ID: 583338908) #> $ConfluenceUrl = "https://arija-confluence.jaas.service.deutschebahn.com" $ApiBase = "$ConfluenceUrl/rest/api" $PageId = "583338908" $ScriptDir = Split-Path -Parent $MyInvocation.MyCommand.Path [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 # Token aus .secrets laden $SecretsPath = Join-Path $ScriptDir "..\.secrets" $PAT = $null if (Test-Path $SecretsPath) { Get-Content $SecretsPath | ForEach-Object { if ($_ -match "^CONFLUENCE_TOKEN=(.+)$") { $val = $Matches[1].Trim() if ($val -ne "HIER_TOKEN_EINTRAGEN") { $PAT = $val } } } } if (-not $PAT) { $PAT = Read-Host "Confluence PAT" } $Headers = @{ "Authorization" = "Bearer $PAT"; "Content-Type" = "application/json" } Write-Host "=== Loesche Test-Seite ===" -ForegroundColor Yellow Write-Host " Seite: TEST Umlaut-Pruefung (ID: $PageId)" # Pruefen ob Seite existiert try { $Resp = Invoke-WebRequest -Uri "$ApiBase/content/$PageId" -Headers $Headers -UseBasicParsing -ErrorAction Stop $Data = $Resp.Content | ConvertFrom-Json Write-Host " Gefunden: $($Data.title)" -ForegroundColor Green } catch { Write-Host " Seite nicht gefunden oder bereits geloescht." -ForegroundColor DarkGray exit 0 } # Loeschen try { Invoke-WebRequest -Uri "$ApiBase/content/$PageId" -Method Delete -Headers $Headers -UseBasicParsing -ErrorAction Stop Write-Host " GELOESCHT!" -ForegroundColor Green } catch { Write-Host " FEHLER: $($_.Exception.Message)" -ForegroundColor Red }