< Back

Set-ConfluenceAttachment

Mon Jan 13, 2020 4:44 am

NAME Set-ConfluenceAttachment



SYNOPSIS

Updates an existing attachment with a new file.





SYNTAX

Set-Attachment [-Attachment] <Attachment> -ApiUri <Uri> [-Credential <PSCredential>] [-Certificate

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





DESCRIPTION

Updates an existing attachment with a new file.





PARAMETERS

-ApiUri <Uri>

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



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



-Attachment <Attachment>

Attachment names to add to the content.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-FilePath <String>

File to be updated.



Required? true

Position? named

Default value None

Accept pipeline input? False

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 --------------------------



$attachment = Get-ConfluenceAttachment -PageID 123456 -FileNameFilter test.png

Set-ConfluenceAttachment -Attachment $attachment -FileName newTest.png -Verbose -Confirm



For the attachment test.png on page with ID 123456, replace the file with the file newTest.png.

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



Get-ConfluenceAttachment -PageID 123456 -FileNameFilter test.png | Set-Attachment -FileName newTest.png -WhatIf



Would replace the attachment test.png to the page with ID 123456. -WhatIf reports on simulated changes, but does

not modify anything.



RELATED LINKS

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

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