Private/New-FormPiece.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
function New-FormPiece {
    Param(
        [Parameter(Mandatory)]
        [string]$Name,
        [Parameter(Mandatory)]
        [AllowEmptyString()]
        [string]$Value,
        [Parameter(Mandatory)]
        [string]$BoundaryTemplate
    )

    'Content-Disposition: form-data; name="{0}"
 
{1}
{2}'
 -f $Name, $Value, $BoundaryTemplate
}