Get-UserPsModulePath() down't handle home folder shares
.NET, PowerShell, SQL, Java, Perl, and Javascript developer libraries
Brought to you by:
msorens
The function doesn't handle user names in homefolder shares to find the user module path.
I.e. This won't resolve
\FILERSERVER\DENLI$\Document\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
A small change to the function will handle this but might capture a wrong path
function Get-UserPsModulePath()
{
$env:PSModulePath.split(";") | ? { $_ -match "\$($env:USERNAME)" }
}
Fixed in 1.2.07
Used a regex that retains robustness, just optionally looking for a trailing dollar sign.
"\$($env:USERNAME)`$?\"