I don't seem to be able to use AND in $search. Below just returns everything in the mailbox.
What did I do wrong?
$api = 'https://graph.microsoft.com/V1.0/users/john.doe@domain.com.au/messages?$search="subject:XYZ" AND "from:jonathan.doe@domain.com.au"'
$messages = Invoke-RestMethod -Headers @{Authorization = "Bearer $($ConnectGraph.access_token)"} -ContentType application/json -Uri $api -Method Get