en-US/about_tcs.confluence.help.txt
|
TOPIC about_tcs.confluence SHORT DESCRIPTION Work with Confluence Cloud pages, spaces, labels and attachments, and build Confluence page content. LONG DESCRIPTION tcs.confluence is part of the TheCodeSaiyan PowerShell suite and needs tcs.core 0.3.0 or later. It has two groups of commands: - REST commands that read, create, update and delete Confluence Cloud pages, search with CQL, read spaces and manage labels and attachments. They use the site and credential set with Set-ConfluenceContext for the current session. Page commands write page objects to the pipeline. - Content builders that return Confluence storage-format (XHTML) text for page bodies. They need no connection. Text is escaped so the output is always well-formed; -Raw inserts storage-format fragments unchanged. Set-ConfluenceContext keeps the credential in memory only, as a PSCredential. It is never written to disk, never returned by Get-ConfluenceContext and never written to the verbose, warning or error streams. Only HTTPS URLs are accepted. The module runs on Windows PowerShell 5.1 and PowerShell 7 on Windows, Linux and macOS. COMMANDS Connection Set-ConfluenceContext Sets the Confluence site and credential used by the other commands. Get-ConfluenceContext Returns the current connection, without the credential. Clear-ConfluenceContext Forgets the connection and credential. Invoke-ConfluenceRequest Sends a request to the Confluence REST API (endpoint building, CQL search, cached space key resolution, 429 retry and pagination). Pages and spaces Get-ConfluencePage Gets pages by ID, by space or by title. Get-ConfluencePageContent Gets pages including their body in the requested format. Get-ConfluencePageChild Gets the child pages of a page, or all descendants with -Recurse. Search-ConfluenceContent Searches with a CQL query. Get-ConfluenceSpace Gets spaces, optionally filtered by name (alias Get-ConfluenceSpaces). New-ConfluencePage Creates a page, or with -Force updates the page with the same title. Update-ConfluencePage Replaces the title and body of a page. Remove-ConfluencePage Deletes a page (-Purge deletes it permanently). Remove-DuplicateConfluencePage Removes duplicate pages that share a title and parent, keeping one (alias Remove-DuplicateConfluencePages). Labels and attachments Get-ConfluencePageLabel Gets the labels of a page. Add-ConfluencePageLabel Adds labels to a page. Remove-ConfluencePageLabel Removes labels from a page. Get-ConfluenceAttachment Gets the attachments of a page. Add-ConfluenceAttachment Uploads files to a page. Content builders New-ConfluenceContentHeader Creates a heading (h1 to h6). New-ConfluenceContentTable Creates a table from objects, hashtables or ordered dictionaries. New-ConfluenceContentCodeBlock Creates a code block macro. New-ConfluenceContentTOC Creates a table of contents macro. New-ConfluenceContentInfo Creates an info, tip, note or warning panel macro. New-ConfluenceContentStatus Creates a status lozenge macro. New-ConfluenceContentExpand Creates an expand (collapsible) macro. New-ConfluenceContentJiraIssue Creates a Jira issue or JQL macro. New-ConfluenceContentLink Creates a hyperlink, or turns every http, https or mailto address in a block of text into a hyperlink. New-ConfluenceContentInternalLink Creates a storage-format link to a Confluence page, optionally to a heading on that page. New-ConfluenceContentDivider Creates a horizontal rule or a blank paragraph. New-ConfluencePageLayout Creates a page layout with one or more sections of one to three columns. Join-ConfluenceContent Joins blocks of content with a separator. ConvertTo-ConfluenceHTML Converts simple Markdown to storage format. Every command has full help, for example: Get-Help New-ConfluencePage -Full CONFIGURATION Settings are managed by tcs.core. The settings file for this module is: <ApplicationData>/PowerShell/Config/tcs.confluence/Module.Config.json It is created with defaults the first time the module loads. Read it with Get-ModuleConfig and change it with Set-ModuleConfig: UpdateWarning Warn on import when a newer version is in the PowerShell Gallery (default $true). UpdateCheckIntervalHours Hours between update checks (default 24). Telemetry Send anonymous usage telemetry (default $true). The update check never blocks import. ENVIRONMENT VARIABLES TCS_TELEMETRY_OPTOUT=1 Turns telemetry off for all tcs modules. TCS_SKIP_UPDATE_CHECK=1 Turns the gallery update check off. TCS_CONFIG_ROOT Moves the settings folder. TELEMETRY tcs.confluence sends anonymous usage events through tcs.core Invoke-TelemetryCollection: one when the module loads and one each time an exported command runs (command name, duration, success, exception type, PowerShell and OS version and a random installation ID). No user, machine, path or error text is sent, and no command arguments, Confluence URLs, page content or credentials. Nothing is sent until a TelemetryUri is configured. Turn it off for this module with: Set-ModuleConfig -ModuleName tcs.confluence -Telemetry $false or for every tcs module with the environment variable TCS_TELEMETRY_OPTOUT=1. EXAMPLES Connect for the current session: Set-ConfluenceContext -ConfluenceUrl 'https://contoso.atlassian.net' -Credential (Get-Credential) Build a page body and create the page, or update it if it exists: $body = Join-ConfluenceContent -Separator HorizontalRule -ContentBlocks @( New-ConfluenceContentTOC New-ConfluenceContentHeader -Header 'Services' -Level 2 New-ConfluenceContentCodeBlock -Content 'Get-Service' -Language powershell ) New-ConfluencePage -SpaceId ENG -ParentId 654321 -Title 'Service report' -Status current -Content $body -Force Find pages by title with a wildcard, reading every result page: Get-ConfluencePage -SpaceKey ENG -Search 'Service*' -All | Select-Object id, title Search with CQL: Search-ConfluenceContent -Cql 'type = page AND label = runbook' Turn off update warnings for tcs.confluence: Set-ModuleConfig -ModuleName tcs.confluence -UpdateWarning $false SEE ALSO about_tcs.core Set-ConfluenceContext Get-ConfluencePage New-ConfluencePage Get-ModuleConfig Set-ModuleConfig https://github.com/ntatschner/TheCodeSaiyan-PowerShell-tcs.confluence KEYWORDS tcs TheCodeSaiyan Confluence Atlassian |