Skip to content

Conversation

@markz0r
Copy link
Member

@markz0r markz0r commented Jun 23, 2025

This pull request introduces several updates to the AtlassianPowerKit module, including enhancements to Confluence page export functionality, the addition of new functions, and structural improvements. Key changes include the addition of a new submodule, updates to module manifests, and improvements to error handling and functionality in Confluence-related scripts.

Submodule Addition:

  • Added a new submodule htmltoadf to .gitmodules for handling HTML to Atlassian Document Format (ADF) conversions.

Module Manifest Updates:

  • Created a new manifest file AtlassianPowerKit-Admin.psd1 for the AtlassianPowerKit module, detailing module metadata, exported functions, and dependencies.

Confluence Functionality Enhancements:

  • Added Export-ConfluencePageToMarkDown function to export Confluence pages to Markdown format (currently a placeholder).
  • Introduced Set-AttachmentForConfluencePage function to upload attachments to Confluence pages.
  • Updated Export-ConfluencePage to support multiple formats (atlas_doc_format, storage) and improved file naming and return structure.
  • Changed default DepthLimit for recursive Confluence page export functions to 10 for better usability. [1] [2]

Error Handling Improvements:

  • Standardized try-catch blocks across multiple functions, ensuring consistent error logging and debugging output. [1] [2] [3] [4] [5] [6] [7] [8]

Function Renaming:

  • Renamed Set-ConfluencePageContent to Set-AttachmentForConfluencePage in the AtlassianPowerKit-Confluence.psd1 manifest for clarity.

$vaultPath = if ($env:OSMAtlassianProfilesVaultPath) {
$env:OSMAtlassianProfilesVaultPath
# Function to set the Atlassian Cloud API headers
function {

Check failure

Code scanning / PSScriptAnalyzer

Missing name after function keyword. Error

Missing name after function keyword.
}
}
# Consolidated Set-AtlassianPowerKitProfile function
function Set-AtlassianPowerKitProfile {

Check warning

Code scanning / PSScriptAnalyzer

Function 'Set-AtlassianPowerKitProfile' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Set-AtlassianPowerKitProfile' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
[Parameter(Mandatory = $false)]
[string]$OSMProfileName,
[Parameter(Mandatory = $false)]
[switch]$Vault = $false

Check warning

Code scanning / PSScriptAnalyzer

The parameter 'Vault' has been declared but not used. Warning

The parameter 'Vault' has been declared but not used.
$OSMUsername = Read-Host 'Enter Atlassian Username (email)'
$OSMUsername = $OSMUsername.Trim().ToLower()
$env:AtlassianPowerKit_AtlassianAPIUserName = $OSMUsername
}

Check warning

Code scanning / PSScriptAnalyzer

Function 'Set-AtlassianAPIHeaders' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Set-AtlassianAPIHeaders' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
}

function Get-LevenshteinDistance {
function New-AtlassianPowerKitProfile {

Check warning

Code scanning / PSScriptAnalyzer

Function 'New-AtlassianPowerKitProfile' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'New-AtlassianPowerKitProfile' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
#Write-Debug "Found required environment variable: $envVarNameKey already set."
$ENV_STATE = $null
& op item create --category 'Secure Note' --vault $1PASSWORD_VAULT --title $1PASSWORD_TITLE $1PASSWORD_FIELD="$(Get-Content $tempPath -Raw)" | Write-Debug
Write-Host "`n✅ Created new 1Password item '$opEntry'."

Check warning

Code scanning / PSScriptAnalyzer

File 'AtlassianPowerKit-Shared.psm1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information. Warning

File 'AtlassianPowerKit-Shared.psm1' uses Write-Host. Avoid using Write-Host because it might not work in all hosts, does not work when there is no host, and (prior to PS 5.0) cannot be suppressed, captured, or redirected. Instead, use Write-Output, Write-Verbose, or Write-Information.
}
Return $true
}
function Remove-AtlassianPowerKitProfile {

Check warning

Code scanning / PSScriptAnalyzer

Function 'Remove-AtlassianPowerKitProfile' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'. Warning

Function 'Remove-AtlassianPowerKitProfile' has verb that could change system state. Therefore, the function has to support 'ShouldProcess'.
}
function Remove-AtlassianPowerKitProfile {
param (
[Parameter(Mandatory = $true)]

Check failure

Code scanning / PSScriptAnalyzer

Parameter declarations are a comma-separated list of variable names with optional initializer expressions. Error

Parameter declarations are a comma-separated list of variable names with optional initializer expressions.
}
function Remove-AtlassianPowerKitProfile {
param (
[Parameter(Mandatory = $true)]

Check failure

Code scanning / PSScriptAnalyzer

Missing ')' in function parameter list. Error

Missing ')' in function parameter list.
}
function Remove-AtlassianPowerKitProfile {
param (
[Parameter(Mandatory = $true)]

Check warning

Code scanning / PSScriptAnalyzer

The parameter 'error' has been declared but not used. Warning

The parameter '__error__' has been declared but not used.
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

Successfully merging this pull request may close these issues.

2 participants