Add-MediaType
- 1 Minute to read
- Print
- DarkLight
- PDF
Add-MediaType
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Summary
Creates a new media type.
Add-MediaType
-Entry
Returns a media type object.
Parameters
Parameter | Type | Required? | Notes |
---|---|---|---|
Entry | Media Type Object | Yes |
Examples
Create a new media type
# Create a new media type
# Create an object with the necessary fields to create the media type
# Note: The name field is the only required system field for the media type object
$entry = @{
Name = "SFTP File Share"
}
# Create the media type. The created entry will be returned back.
$data = Add-MediaType -Entry $entry
# Output some information to help indicate that the media type was created
Write-Output "Media type $($data.MediaTypeId) ($($data.Name)) was created"
# 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:
Media type 16 (SFTP File Share) was created
JSON Results:
{
"MediaTypeId": 16,
"Name": "SFTP File Share",
"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:50:06.3941473+00:00",
"LastUpdatedBy": null
}