Tuesday, July 17, 2012

Managing Powershell Profile.ps1 with SkyDrive

I use SkyDrive to sync pretty much all of my data (I was an early adopter and so they gave me 25GB free). SkyDrive lives at $home\SkyDrive, and my Powershell Profile.ps1 lives at $home\Documents\WindowsPowerShell\Profile.ps1.

To manage it, I created a folder named $home\SkyDrive\Documents\WindowsPowerShell and used mklink to create a symbolic link (yes, NTFS supports symlinks). Start cmd.exe as an Administrator:

cd \users\username\Documents
mklink /D "WindowsPowerShell" "..\SkyDrive\Documents\WindowsPowerShell"


Now I can keep my profile and various modules & utilities (notably PSCX and git-tfs) in my Powershell folder and roam from machine to machine. Bliss!

No comments: