--- title: "Get-MediaType" slug: "scripting-get-mediatype" updated: 2026-01-22T13:47:01Z published: 2026-01-22T13:47:01Z canonical: "help.agilityblue.com/scripting-get-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. # Get-MediaType ## Summary Retrieves an existing media type. ```powershell Get-MediaType    -Id ``` Returns a [media type](https://apidocs.agilityblue.com/#559af567-0810-408a-8ca3-c4a21e1bfde0) object. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | Id | Int32 | Yes | The media type id. | ## Examples ### Get an existing media type This example retrieves a specific media type and outputs it as JSON. ```powershell # Retrieve a specific media type by id $data = Get-MediaType -Id 9 Write-Output "Retrieved media type $($data.Name)" # Convert the media type to output as JSON $jsonOutput = $data | ConvertTo-Json -Depth 10 # 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 Retrieved media type Computer JSON Results: {  "MediaTypeId": 9,  "Name": "Computer",  "NumberOfMediaLogs": 7,  "CreatedByFullName": "Max Miller",  "CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",  "CreatedOn": "2016-06-18T16:25:42.7780883-05:00",  "CreatedBy": null,  "LastUpdatedByFullName": "Max Miller",  "LastUpdatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",  "LastUpdatedOn": "2016-06-18T16:25:42.7780883-05:00",  "LastUpdatedBy": null } ```