A while ago I wrote a script that can mount Teams Libraries and then redirect any local folder to them.
In many situations, this solution is a little overkill though, so I’ve also created a second version which simply allows you to redirect any local folder (including variable paths!) to any location in a user’s Onedrive folder.
The configuration is set through the registry, an example file is included.
It can be used as a onetimer or as logonscript, and it can also be used to migrate existing content or create hard links for specific local appdata folders.