< Back

Add-ConfluenceAttachment

Mon Jan 13, 2020 4:25 am

NAME Add-ConfluenceAttachment



SYNOPSIS

Add a new attachment to an existing Confluence page.





SYNTAX

Add-Attachment [-PageID] <Int32> -ApiUri <Uri> [-Credential <PSCredential>] [-Certificate <X509Certificate>]

-FilePath <String[]> [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Add Attachments (one or more) to Confluence pages (one or more). If the Attachment did not exist previously, it

will be created.



This will not update an already existing Attachment; see Set-Attachment for updating a file.





PARAMETERS

-ApiUri <Uri>

The URi of the API interface. Value can be set persistently with Set-Info.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

Confluence's credentials for authentication. Value can be set persistently with Set-ConfluenceInfo.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Certificate <X509Certificate>

Certificate for authentication.



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-PageID <Int32>

The ID of the page to which apply the Attachment to. Accepts multiple IDs, including via pipeline input.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-FilePath <String[]>

One or more files to be added.



Required? true

Position? named

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

Shows what would happen if the cmdlet runs.



The cmdlet is not run.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

ConfluencePS.Attachment







NOTES









-------------------------- EXAMPLE 1 --------------------------



Add-ConfluenceAttachment -PageID 123456 -FilePath test.png -Verbose



Adds the Attachment test.png to the wiki page with ID 123456. -Verbose output provides extra technical details, if

interested.

-------------------------- EXAMPLE 2 --------------------------



Get-ConfluencePage -SpaceKey SRV | Add-ConfluenceAttachment -FilePath test.png -WhatIf



Simulates adding the Attachment test.png to all pages in the space with key SRV. -WhatIf provides PageIDs of pages

that would have been affected.



RELATED LINKS

Online Version: https://atlassianps.org/docs/Confluence ... ttachment/

https://github.com/AtlassianPS/ConfluencePS https://github.com/AtlassianPS/ConfluencePS