A PowerShell script to create symbolic links between OneDrive User directory and local User directory, enabling seamless synchronization of user settings and configurations.
- Creates symbolic links for files from OneDrive to local directory
- Maintains directory structure without creating directory links
- Automatically backs up existing files with .bak extension
- Provides detailed logging of operations
- Handles errors gracefully
- Windows 10/11
- PowerShell 3.0 or later
- Administrator privileges
- OneDrive installed and configured
Source: %USERPROFILE%\OneDrive\Users
Target: C:\Users
- Open Windows Terminal as Administrator
- Navigate to script directory
- Run the script:
.\onedrive_forcelink.ps1
- Execution Policy
# Run as administrator to allow script execution
Set-ExecutionPolicy RemoteSigned
-
File Extension Make sure the script has .ps1 extension (not .psl)
-
Access Denied Run Windows Terminal as Administrator
- Original files are automatically backed up with .bak extension
- Example:
config.json
→config.json.bak
- Only files are linked, directories are created normally
- Existing symbolic links are preserved
- Script requires administrator privileges
- Designed for Windows environments
- VSCode settings sync
- Cursor settings sync
- Windows Terminal settings sync
MIT