--- title: "Set-MediaType" slug: "scripting-set-mediatype" updated: 2026-01-22T13:56:09Z published: 2026-01-22T13:56:09Z canonical: "help.agilityblue.com/scripting-set-mediatype" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.agilityblue.com/llms.txt > Use this file to discover all available pages before exploring further. # Set-MediaType ## Summary Updates an existing media type. ```powershell Set-MediaType    -Entry ``` Returns a [media type](https://apidocs.agilityblue.com/#559af567-0810-408a-8ca3-c4a21e1bfde0) object. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | Entry | [Media Type](https://apidocs.agilityblue.com/#559af567-0810-408a-8ca3-c4a21e1bfde0) Object | Yes | | ## Examples ### Update an existing media type ```powershell # Update an existing media type # A common flow for updating existing data is to first retrieve the data using the GET # command, update specific fields, and then provide the modified data back using the SET command. $entry = Get-MediaType -Id 16 # Update the "Name" system field: $entry.Name = "Secure File Transfer Protocol (SFTP)" # Save the modified media type $data = Set-MediaType -Entry $entry # Output some information to help indicate that the media type was updated Write-Output "Media type $($data.MediaTypeId) ($($data.Name)) was updated" # For debug purposes, convert the data to output as JSON so we can see all the fields Write-Output "" Write-Output "JSON Results:" $jsonOutput = $data | ConvertTo-Json -Depth 10 # Output the data Write-Output $jsonOutput ``` Execution results: ```json Media type 16 (Secure File Transfer Protocol (SFTP)) was updated JSON Results: {  "MediaTypeId": 16,  "Name": "Secure File Transfer Protocol (SFTP)",  "NumberOfMediaLogs": 0,  "CreatedByFullName": "Max Miller",  "CreatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",  "CreatedOn": "2024-04-18T12:50:06.3941473+00:00",  "CreatedBy": null,  "LastUpdatedByFullName": "Max Miller",  "LastUpdatedById": "25a34a2f-e3d8-4690-88f5-6b399cf88c4c",  "LastUpdatedOn": "2024-04-18T12:53:02.7660779+00:00",  "LastUpdatedBy": null } ```