On this page

Get-Attachment

SYNOPSIS

Retrieve the child Attachments of a given wiki Page.

SYNTAX

Get-ConfluenceAttachment -apiURi <Uri> -Credential <PSCredential> [-PageID] <Int32[]> [-FileNameFilter <string>] [-MediaTypeFilter <string>] [-Skip <UInt64>] [-First <UInt64>] [-PageSize <UInt64>] [-IncludeTotalCount]

DESCRIPTION

Return all Attachments directly below the given Page.

EXAMPLES

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

Get-ConfluenceAttachment -PageID 123456
Get-ConfluencePage -PageID 123456 | Get-ConfluenceAttachment

Two different methods to return all Attachments directly below Page 123456. Both examples should return identical results.

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

Get-ConfluenceAttachment -PageID 123456, 234567
Get-ConfluencePage -PageID 123456, 234567 | Get-ConfluenceAttachment

Similar to the previous example, this shows two different methods to return the Attachments of multiple pages. Both examples should return identical results.

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

Get-ConfluenceAttachment -PageID 123456 -FileNameFilter "test.png"

Returns the Attachment called test.png from Page 123456 if it exists.

————————– EXAMPLE 4 ————————–

Get-ConfluenceAttachment -PageID 123456 -MediaTypeFilter "image/png"

Returns any attachments of mime type image/png from 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

-PageID

Return attachments for a list of page IDs.

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

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

-FileNameFilter

Filter results by filename (case sensitive). Does not support wildcards (*).

Type: String
Parameter Sets: (All)
Aliases:

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

-MediaTypeFilter

Filter results by media type (case insensitive).

Does not support wildcards (*).

Type: String
Parameter Sets: (All)
Aliases:

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

-PageSize

Maximum number of results to fetch per call.

This setting can be tuned to get better performance according to the load on the server.

Warning: too high of a PageSize can cause a timeout on the request.

Type: Int32
Parameter Sets: (All)
Aliases:

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

-Skip

Controls how many things will be skipped before starting output.

Defaults to 0.

Type: UInt64
Parameter Sets: (All)
Aliases:

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

-First

NOTE: Not yet implemented.

Indicates how many items to return.

Type: UInt64
Parameter Sets: (All)
Aliases:

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

-IncludeTotalCount

NOTE: Not yet implemented.

Causes an extra output of the total count at the beginning.

Note this is actually a uInt64, but with a custom string representation.

Type: SwitchParameter

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

INPUTS

OUTPUTS

ConfluencePS.Attachment

NOTES

Confluence uses hierarchy to help organize content. This command is meant to help provide the intended context from the command line.

https://github.com/AtlassianPS/ConfluencePS