Your query string parameter is wrapped in single quotes. Inside the single quotes you are using single quotes again so the compiler sees the single quote on the 'Machines
section as the end of the string followed by Machines
. If you need to use single quotes inside a string then use double quotes around the outer string. Alternatively escape the single quotes inside the string so it is seen as single quotes.
$result = Search-AzGraph -Query "patchinstallationresources
| where type =~ 'microsoft.compute/virtualmachines/patchinstallationresults'
| where properties.lastModifiedDateTime > ago(1d )
| extend InstallationStatus = tostring(properties.status)
| parse id with * 'Machines/' resourceName '/patchInstallationResults/' *
| project resourceName, InstallationStatus
| join kind = leftouter
(resources
| where type == 'microsoft.compute/virtualmachines'
| extend vmsid = properties.vmId
| project vmsid , name
)
on $left.resourceName == $right.name
| project vmsid, resourceName, InstallationStatus"