PowerShell Script to Reset OneDrive
Here is a PowerShell script that performs the reset steps described in the Microsoft support article.
It attempts to reset the Windows Store cache (step 1 from the guide) and then iterates through the known installation paths for OneDrive to execute the specific reset command (steps 4-6). Finally, it attempts to restart the application.
What the script does: wsreset.exe: It runs the Windows Store reset command first, which opens and closes a blank window (as noted in the article).
Path Detection: It checks the three specific paths mentioned in the article (%localappdata%, Program Files, and Program Files (x86)) to find where your specific version of OneDrive is installed.
Reset: It runs the /reset switch on the executable it finds.
Restart: It launches OneDrive again so it can start syncing.