functions/generated/WorkItemTracking/Set-AdsWitAttachment.ps1

function Set-AdsWitAttachment {
<#
.SYNOPSIS
     
 
.DESCRIPTION
    Uploads an attachment.
 
On accounts with higher attachment upload limits (>130MB), you will need to use chunked upload.
To upload an attachment in multiple chunks, you first need to [**Start a Chunked Upload**](#start_a_chunked_upload) and then follow the example from the **Upload Chunk** section.
 
.PARAMETER AreaPath
    Target project Area Path
 
.PARAMETER FileName
    The name of the file
 
.PARAMETER UploadType
    Attachment upload type: Simple or Chunked
 
.PARAMETER Project
    Project ID or project name
 
.PARAMETER Organization
    The name of the Azure DevOps organization.
 
.PARAMETER ApiVersion
    Version of the API to use. This should be set to '7.1-preview.3' to use this version of the api.
 
.EXAMPLE
    PS C:\> Set-AdsWitAttachment -Project $project -Organization $organization -ApiVersion $apiversion
 
    Uploads an attachment.
 
On accounts with higher attachment upload limits (>130MB), you will need to use chunked upload.
To upload an attachment in multiple chunks, you first need to [**Start a Chunked Upload**](#start_a_chunked_upload) and then follow the example from the **Upload Chunk** section.
 
.LINK
    <unknown>
#>

    [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
    [CmdletBinding(DefaultParameterSetName = 'default')]
    param (
        [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [string]
        $AreaPath,

        [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [string]
        $FileName,

        [Parameter(ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [string]
        $UploadType,

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [string]
        $Project,

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [string]
        $Organization,

        [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ParameterSetName = 'default')]
        [string]
        $ApiVersion
    )
    process {
        $__mapping = @{
            'AreaPath' = 'areaPath'
            'FileName' = 'fileName'
            'UploadType' = 'uploadType'
            'ApiVersion' = 'api-version'
        }
        $__body = $PSBoundParameters | ConvertTo-Hashtable -Include @() -Mapping $__mapping
        $__query = $PSBoundParameters | ConvertTo-Hashtable -Include @('AreaPath','FileName','UploadType','ApiVersion') -Mapping $__mapping
        $__header = $PSBoundParameters | ConvertTo-Hashtable -Include @() -Mapping $__mapping
        $__path = 'https://dev.azure.com/{organization}/{project}/_apis/wit/attachments' -Replace '{project}',$Project -Replace '{organization}',$Organization

        Invoke-RestRequest -Path $__path -Method post -Body $__body -Query $__query -Header $__header
    }
}