Modifying an Outlook Calendar Appointment

I have been searching online and have yet to determine how to do this. I have a customer that asked for some assistance with automating creating, finding, and deleting calendar appointments in Outlook (not O365). This is easy enough with the Outlook Object and OLAppointmentItem like so:

$sDate = "05/10/2019"
$ol = New-Object -ComObject Outlook.Application
$meeting = $ol.CreateItem('olAppointmentItem')
$meeting.Subject = "My Test"
$meeting.Body = "Let's have a meeting"
$meeting.Location = "My desk"
$meeting.ReminderSet = $true
$meeting.Importance = 1
$meeting.MeetingStatus = [Microsoft.Office.Interop.Outlook.OlMeetingStatus]::olMeeting
$meeting.ReminderMinutesBeforeStart = 15
$meeting.Start = "$($sDate) 11:00"
$meeting.End = "$($sDate) 12:00"
$meeting.Duration = 30

The customer, however, came back and is asking for a way to modify the subject line of existing appointments. I confess I have never had to do this; usually if you create an appointment it is done. I have been looking through the object model, and I can obtain the AppointmentItem object in question, but see no way to modify it. Just curious if anyone has ever done this.

I don’t have experience here but this is how you can grab an existing meeting/appointment from the calendar. You then end up with an object very like what you’re using in your example. A quick test shows that I can change the meeting name on my calendar but I’m guessing this is a local change only. Not sure about sending the updated meeting to others since the send() method doesn’t do anything for me.

$ol = New-Object -ComObject outlook.application
$ns = $ol.GetNamespace('MAPI')
$meeting = $ns.folders.item('').folders.item('Calendar').items | Where-Object Subject -eq 'Meeting Subject'
$meeting.Subject = 'New subject'

Thanks, I actually figured out how to do it just after posting (as is always the way). I did it like this:

$olFolderCalendar = 9
$ol = New-Object -ComObject Outlook.Application
$myAppointment = $ol.GetNamespace('MAPI').GetDefaultFolder($olFolderCalendar).Items("My Test")
$myAppointment.ItemProperties.Item("Subject").Value = "New Subject"