Get-PSProfile fails to find profiles that are in moved Documents folders
corbob opened this issue · comments
Describe the bug
OneDrive includes a feature that allows you to move your Documents (among other folders) to OneDrive. Get-PSProfile with it's hard coded locations is unable to locate the profiles in this case.
To Reproduce
Steps to reproduce the behavior:
- In Windows Explorer navigate to the Documents folder
- Right Click on Document folder and choose Properties
- Switch to Location tab
- Click Move and pick a new location for Documents
- Click OK
- Run Get-PSProfile
- Note that user profiles are no longer detected
Expected behavior
Expect the function to locate the profile when it is in the Documents Folder in the standard location.
Screenshots
In this screenshot I ran the command, then moved my Documents folder to OneDrive. The warnings are a side effect of a change I was experimenting with of detecting both VS Code and VS Code Insiders.
Desktop (please complete the following information):
- Operating System Version: 10.0.19041 (Windows 10 2004)
- Module Version: 2.30.0 (downloaded and ran from git repository)
- PowerShell Version: 7.0.3
Additional context
I have some code that will detect the proper location that I would like to submit as a PR. This would also be an issue in a corporate environment that has redirected the Documents folder to a network drive or other location.
I'll have to look into this further. Although you are welcome to submit a PR. And even though it shouldn't make a difference, you should really install the module from the PowerShell Gallery and not download this repository.