Get-MediaType
- 1 Minute to read
- Print
- DarkLight
- PDF
Get-MediaType
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Summary
Retrieves an existing media type.
Get-MediaType
-Id
Returns a media type 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.
# 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:
Retrieved media type Computer
JSON Results:
{
"MediaTypeId": 9,
"Name": "Computer",
"NumberOfMediaLogs": 7,
"CreatedByFullName": "Service Account",
"CreatedById": "410e109b-6ff5-4442-9670-cd5e3cd82a7f",
"CreatedOn": "2016-06-18T16:25:42.7780883-05:00",
"CreatedBy": null,
"LastUpdatedByFullName": "Service Account",
"LastUpdatedById": "410e109b-6ff5-4442-9670-cd5e3cd82a7f",
"LastUpdatedOn": "2016-06-18T16:25:42.7780883-05:00",
"LastUpdatedBy": null
}