When using the EnableOneDriveFinderSync.sh script as instructed, the logs show "match: connection invalid" and the OneDrive Finder Extension is not enabled.
The remainder of the script then fails, because the variable isn't populated.
Run script as signed-in user : Yes
I've tested on both ADE and Company Portal enrollment on latest macOS Sonoma 14.5.
The issue seems to occur when deployed by MDM. Running the script locally works.

When using the EnableOneDriveFinderSync.sh script as instructed, the logs show "match: connection invalid" and the OneDrive Finder Extension is not enabled.
The remainder of the script then fails, because the variable isn't populated.
Run script as signed-in user : Yes
I've tested on both ADE and Company Portal enrollment on latest macOS Sonoma 14.5.
The issue seems to occur when deployed by MDM. Running the script locally works.