While playing with powershell, I've just noticed that the `$HOME` variable won't give me the correct result if the user's data folders are moved to a different drive. For instance, let's assume two drives (C: and D:) and that the user has moved his Documents data folder to D:.

When that happens, `$HOME` still resolves to `C:\Users\username\...` and that means that using it for getting the user's [profile file](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_profiles?view=powershell-7.1) won't give me access to his profile file (which now is in `D:\users\username\Documents\Powershell\Microsoft.PowerShell_profile.ps1`

Any tips on how to get to the user's profile when the user moves his data folders to another drive?

Thanks.