Hi @Rohman, William T ,
I'm glad to hear you solve the problem, if you have any issue about SharePoint, you are welcome to raise a ticket in this forum.I would make a brief summary of this thread:
Issue Symptom:
Create a onedrive sync of a specific folder using power automate or powershell.
Current status:
The issue has been solved. Shawn's Suggestion Works! Using the following powershell:
$sharepointLibraryURL = "https://yourorganization.sharepoint.com/sites/YourSite/Shared Documents/YourLibrary"
Path to OneDrive executable
$oneDrivePath = "$env:LOCALAPPDATA\Microsoft\OneDrive\OneDrive.exe"
Start syncing the SharePoint library with OneDrive
Start-Process -FilePath $oneDrivePath -ArgumentList "/url:$sharepointLibraryURL"
I'm going to turn Shawn's comment into an answer.
You could click the "Accept Answer" button for this summary or Shawn's answer to close this thread, and this can make it easier for other community member's to see the useful information when reading this thread. Thanks for your understanding!