< Back

Get-JiraIssueAttachmentFile

Thu Jan 16, 2020 7:54 am

NAME Get-JiraIssueAttachmentFile



SYNOPSIS

Save an attachment to disk.





SYNTAX

Get-JiraIssueAttachmentFile [-Attachment] <JiraPS.Attachment> [[-Path] <String>] [[-Credential] <PSCredential>]

[<CommonParameters>]





DESCRIPTION

This function downloads an attachment of an issue to the local disk.





PARAMETERS

-Attachment <JiraPS.Attachment>

Attachment which will be downloaded.



Required? true

Position? 1

Default value None

Accept pipeline input? True (ByValue)

Accept wildcard characters? false



-Path <String>

Path in which to store to attachment.



The name of the file will be appended to the Path provided.



Required? false

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

Credentials to use to connect to JIRA.

If not specified, this function will use anonymous access.



Required? false

Position? 3

Default value None

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

[JiraPS.Attachment]







OUTPUTS

[Bool]







NOTES





This function requires either the `-Credential` parameter to be passed or a persistent JIRA session. See

`New-JiraSession` for more details. If neither are supplied, this function will run with anonymous access to

JIRA.



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



Get-JiraIssueAttachmentFile (Get-JiraIssueAttachment -Issue TEST-001)



This example downloads all attachments from issue TEST-001 to the current working directory.

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



Get-JiraIssue TEST-002 | Get-JiraIssueAttachment | Get-JiraIssueAttachmentFile



This example illustrates use of the pipeline to download all attachments from issue TEST-002.

-------------------------- EXAMPLE 3 --------------------------



Get-JiraIssue TEST-002 |

Get-JiraIssueAttachment -FileName "*.png" |

Get-JiraIssueAttachmentFile -Path "c:\\temp



Download all attachments of issue TEST-002 where the filename ends in `.png` to a specific location.



RELATED LINKS

Online Version: https://atlassianps.org/docs/JiraPS/com ... hmentFile/

Get-JiraAttachment

Add-JiraIssueAttachmentFile

Get-JiraIssue

Remove-JiraIssueAttachmentFile