Open mattcargile opened 1 year ago
OneDrive is a royal pain. I'm using an "Enterprise" OneDrive (even at home), rather than a personal one, so not only is it redirecting my Documents, etc., it's actually putting "OneDrive - CompanyName" in the path ... with SPACES in the folder name that just make everything difficult.
You are correct though, the run_after_symlink.ps1
script is the magic.
There actually isn't a symlink at all. Even though I chose that name for the file, I ended up deciding to just copy the profile multiple times. Creating symlinks on Windows requires elevation, and is not necessary.
The important thing is:
$Env:OneDriveCommercial
to find the right location. If you're using personal OneDrive, you can use $Env:OneDrive
. .tmpl
file. The go-template snippet # profile hash: {{ include "profile.ps1" | sha256sum }}
would ensure that this file would change whenever the profile.ps1 file changes... but I decided that I wanted to always overwrite the profile ... since we can't tell if the copies have been messed with ;-)Some of the stuff that I was trying to make happen when I did that ended up not working (i.e. I was hoping powershell.config.json would let me configure where PowerShell searches for it's profile, but that has never been implemented by Microsoft).
Hey Jaykul -
Just getting into
chezmoi
and I was perusing your files. I see you make reference to OneDrive. How are you handling that? Are you doingchezmoi --destination ~\OneDrive
as your root? Or are you actually using symbolic links instead?Additionally, how are you creating your
$PROFILE
? Is that another link or do you just dot-source thechezmoi
profile template?So I see the below file which puts some of the pieces together. I assume there is code elsewhere to create the symlink?
https://github.com/Jaykul/dotfiles/blob/master/dot_config/powershell/run_after_symlink.ps1