Creates multipart/form-data to send as a request body.
ConvertTo-MultipartFormData.ps1 [-Fields] <IDictionary> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
@{ title = 'Name'; file = Get-Item avartar.png } |ConvertTo-MultipartFormData.ps1 |Invoke-WebRequest $url -Method POST
Sends two fields, one of which is a file upload.
The fields to pass, as a Hashtable or other dictionary. Values of the System.IO.FileInfo type will be read, as for a file upload.
Type: IDictionary
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
https://docs.microsoft.com/dotnet/api/system.net.http.multipartformdatacontent