On this page

Remove-Attachment

SYNOPSIS

Remove an Attachment.

SYNTAX

Remove-ConfluenceAttachment -apiURi <Uri> -Credential <PSCredential> [-Attachment] <Attachment[]> [-WhatIf] [-Confirm]

DESCRIPTION

Remove Attachments from Confluence content.

Does accept multiple pages piped via Get-ConfluencePage.

Untested against non-page content.

EXAMPLES

————————– EXAMPLE 1 ————————–

$attachments = Get-ConfluenceAttachment -PageID 123456
Remove-ConfluenceAttachment -Attachment $attachments -Verbose -Confirm

Remove all attachment from page 12345 Verbose and Confirm flags both active; you will be prompted before deletion.

————————– EXAMPLE 2 ————————–

Get-ConfluenceAttachment -PageID 123456 | Remove-ConfluenceAttachment -WhatIf

Do trial deletion for all attachments on page with ID 123456, the WhatIf parameter prevents any modifications.

————————– EXAMPLE 3 ————————–

Get-ConfluenceAttachment -PageID 123456 | Remove-ConfluenceAttachment

Remove all Attachments on page 123456.

PARAMETERS

-apiURi

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

Type: Uri
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Credential

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

Type: PSCredential
Parameter Sets: (All)
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Attachment

The Attachment(s) to remove.

Type: Attachment[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

INPUTS

OUTPUTS

NOTES

https://github.com/AtlassianPS/ConfluencePS